Class DemoModel

java.lang.Object
provided.owlMaps.demo.model.DemoModel

public class DemoModel
extends java.lang.Object
The model for the OwlMaps demo app
Author:
swong
  • Field Summary

    Fields
    Modifier and Type Field Description
    private IModel2ViewAdapter model2ViewAdpt
    The adapter to the view
    private IOwlMap owlMap
    A local reference to the map itself.
    private IOwlMapControl owlMapControl
    The OwlMapControl object that runs everything about the map.
    private IOwlMapUtils owlMapUtils
    The map-dependent map utilities
  • Constructor Summary

    Constructors
    Constructor Description
    DemoModel​(IModel2ViewAdapter model2ViewAdpt, java.lang.String googleMapsApiKey)
    Construct the demo model
  • Method Summary

    Modifier and Type Method Description
    void addGeoJson()
    Add GeoJSON data using the currently set data styling.
    void goToLatLng​(ILatLng latLng)
    Pan the map to the given ILatLng location
    void goToPlace​(IPlace place)
    Move the map to the given IPlace location and zoom level
    void loadGeoJson()
    Load outlines of world countries with a specific default styling and an overridden styling for USA.
    void makeCircle​(ILatLng originLatLng)
    Make an ICircle object at the given location
    void makeInfoWin​(ILatLng latLng)
    Make an IInfoWindow object at the given location
    void makeMarker​(ILatLng latLng)
    Make an IMarker object at the given location
    void makeOverlay​(ILatLng originLatLng)
    Make an overlay centered at the given lat/lng
    void makePolygon​(ILatLng originLatLng)
    Make an IPolygon object at the given location
    void makePolyline​(ILatLng originLatLng)
    Make an IPolyline object at the given location
    void makeRectangle​(ILatLng originLatLng)
    Make an IRectangle object at the given location
    void resetMap()
    Reset the map.
    void start()
    Start the model.
    void stop()
    Stop the model.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • model2ViewAdpt

      private IModel2ViewAdapter model2ViewAdpt
      The adapter to the view
    • owlMapControl

      private IOwlMapControl owlMapControl
      The OwlMapControl object that runs everything about the map.
    • owlMap

      private IOwlMap owlMap
      A local reference to the map itself. This could have always been retrieved directly from the OwlMapControl object.
    • owlMapUtils

      private IOwlMapUtils owlMapUtils
      The map-dependent map utilities
  • Constructor Details

    • DemoModel

      public DemoModel​(IModel2ViewAdapter model2ViewAdpt, java.lang.String googleMapsApiKey)
      Construct the demo model
      Parameters:
      model2ViewAdpt - The adapter to the view
      googleMapsApiKey - The Google Maps API key to use
  • Method Details

    • start

      public void start()
      Start the model.
    • resetMap

      public void resetMap()
      Reset the map. Currently, only sets the options back to their default settings.
    • stop

      public void stop()
      Stop the model. Must call this when exiting in order to stop the JxBrowser engine.
    • goToLatLng

      public void goToLatLng​(ILatLng latLng)
      Pan the map to the given ILatLng location
      Parameters:
      latLng - The location to pan to
    • goToPlace

      public void goToPlace​(IPlace place)
      Move the map to the given IPlace location and zoom level
      Parameters:
      place - The IPlace to move to
    • makeMarker

      public void makeMarker​(ILatLng latLng)
      Make an IMarker object at the given location
      Parameters:
      latLng - The desired location of the marker
    • makeInfoWin

      public void makeInfoWin​(ILatLng latLng)
      Make an IInfoWindow object at the given location
      Parameters:
      latLng - The desired location of the info window
    • makePolygon

      public void makePolygon​(ILatLng originLatLng)
      Make an IPolygon object at the given location
      Parameters:
      originLatLng - The desired location of the origin point of the polygon
    • makePolyline

      public void makePolyline​(ILatLng originLatLng)
      Make an IPolyline object at the given location
      Parameters:
      originLatLng - The desired location of the origin point of the polyline
    • makeRectangle

      public void makeRectangle​(ILatLng originLatLng)
      Make an IRectangle object at the given location
      Parameters:
      originLatLng - The desired location of the origin point of the rectangle
    • makeCircle

      public void makeCircle​(ILatLng originLatLng)
      Make an ICircle object at the given location
      Parameters:
      originLatLng - The desired location of the center the circle
    • makeOverlay

      public void makeOverlay​(ILatLng originLatLng)
      Make an overlay centered at the given lat/lng
      Parameters:
      originLatLng - The center of the image
    • loadGeoJson

      public void loadGeoJson()
      Load outlines of world countries with a specific default styling and an overridden styling for USA. The new default styling may change the appearance of an existing feature that uses the default styling.
    • addGeoJson

      public void addGeoJson()
      Add GeoJSON data using the currently set data styling. Note that the styling will change if the default styling is changed.