Package provided.owlMaps.demo.model
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 IModel2ViewAdaptermodel2ViewAdptThe adapter to the viewprivate IOwlMapowlMapA local reference to the map itself.private IOwlMapControlowlMapControlThe OwlMapControl object that runs everything about the map.private IOwlMapUtilsowlMapUtilsThe 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 voidaddGeoJson()Add GeoJSON data using the currently set data styling.voidgoToLatLng(ILatLng latLng)Pan the map to the given ILatLng locationvoidgoToPlace(IPlace place)Move the map to the given IPlace location and zoom levelvoidloadGeoJson()Load outlines of world countries with a specific default styling and an overridden styling for USA.voidmakeCircle(ILatLng originLatLng)Make an ICircle object at the given locationvoidmakeInfoWin(ILatLng latLng)Make an IInfoWindow object at the given locationvoidmakeMarker(ILatLng latLng)Make an IMarker object at the given locationvoidmakeOverlay(ILatLng originLatLng)Make an overlay centered at the given lat/lngvoidmakePolygon(ILatLng originLatLng)Make an IPolygon object at the given locationvoidmakePolyline(ILatLng originLatLng)Make an IPolyline object at the given locationvoidmakeRectangle(ILatLng originLatLng)Make an IRectangle object at the given locationvoidresetMap()Reset the map.voidstart()Start the model.voidstop()Stop the model.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
model2ViewAdpt
The adapter to the view -
owlMapControl
The OwlMapControl object that runs everything about the map. -
owlMap
A local reference to the map itself. This could have always been retrieved directly from the OwlMapControl object. -
owlMapUtils
The map-dependent map utilities
-
-
Constructor Details
-
DemoModel
Construct the demo model- Parameters:
model2ViewAdpt- The adapter to the viewgoogleMapsApiKey- 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
Pan the map to the given ILatLng location- Parameters:
latLng- The location to pan to
-
goToPlace
Move the map to the given IPlace location and zoom level- Parameters:
place- The IPlace to move to
-
makeMarker
Make an IMarker object at the given location- Parameters:
latLng- The desired location of the marker
-
makeInfoWin
Make an IInfoWindow object at the given location- Parameters:
latLng- The desired location of the info window
-
makePolygon
Make an IPolygon object at the given location- Parameters:
originLatLng- The desired location of the origin point of the polygon
-
makePolyline
Make an IPolyline object at the given location- Parameters:
originLatLng- The desired location of the origin point of the polyline
-
makeRectangle
Make an IRectangle object at the given location- Parameters:
originLatLng- The desired location of the origin point of the rectangle
-
makeCircle
Make an ICircle object at the given location- Parameters:
originLatLng- The desired location of the center the circle
-
makeOverlay
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.
-