AnyLogic
Expand
Font size

Class ShapeGISMap

All Implemented Interfaces:
com.anylogic.engine.internal.Child, Locatable2D, Locatable3D, AggregatableAnimationElement, HasLevel, LevelElement, SVGElement, Serializable, Cloneable

public class ShapeGISMap
extends AbstractShapeGISMap
GIS map projection manager and map renderer (persistent GIS Map shape which displays and map projection)
GIS map is a Shape and it can be placed on the model animation: it renders the associated map projection on the screen
This class provides several projection methods

General information:
Coordinates of any point are presented as:

  • the latitude of point, measured in degrees (-90 ... (South) ... 0 ... (North) ... +90)
  • the longitude of point, measured in degrees (-180 ... (West) ... 0 ... (East) ... +180)
The following order of coordinates is assumed: (latitude, longitude) Implementation is based on OpenMap GIS
Author:
AnyLogic North America, LLC https://anylogic.com
See Also:
Serialized Form

Nested Class Summary

Modifier and TypeClassDescription
static class ShapeGISMap.Layer
Class which stores GIS map layer information

Field Summary

Modifier and TypeFieldDescription
static final ITileURLProviderCLASSIC 
static final ITileURLProviderGERMANSTYLE 
static final ITileURLProviderHUMANITARIAN 
static final AbstractGISRouteProviderSTRAIGHT 
static final ITileURLProviderTRANSPORT 

Fields inherited from class com.anylogic.engine.presentation.Shape3D

UNKNOWN_NAME

Constructor Summary

ConstructorDescription
ShapeGISMap(Presentable presentable, ShapeDrawMode drawMode, boolean ispublic, double x, double y, double width, double height, String packagePrefix, ShapeGISMap.Layer[] layers, double centerLatitude, double centerLongitude, double mapScale, Color mapBorderColor, Color mapBackgroundColor, boolean showTiles, TileURLProviderType tileURLProviderType, IGISRouteProvider routeProvider, int precisionInMeters, boolean showRouteNotFoundError)
Constructs a GIS Map shape with specific attributes.
ShapeGISMap(Presentable presentable, ShapeDrawMode drawMode, boolean ispublic, double x, double y, double width, double height, String packagePrefix, ShapeGISMap.Layer[] layers, double centerLatitude, double centerLongitude, double mapScale, Color mapBorderColor, Color mapBackgroundColor, boolean showTiles, String[] tileURLs, IGISRouteProvider routeProvider, int precisionInMeters, boolean showRouteNotFoundError)
Constructs a GIS Map shape with specific attributes.

Method Summary

Modifier and TypeMethodDescription
voidadd(GISMultiRegion markupElement)
Adds GIS markup element to drawing set of elements.
voidadd(GISMarkupElement markupElement)
Adds GIS markup element to drawing set of elements.
voidaddImageChangedListener(ImageChangedListener listener)
Deprecated.
voidchangeViewPosition(double latitude, double longitude, double zoom)
Remember user changes of the map view position.
booleancontains(double px, double py)
Test if the shape contains the point with the given coordinates (relative to this shape's container, i.e.
PointconvertForward(double latitude, double longitude)
Deprecated.
this function is deprecated and will be removed in the next release
PointconvertForward(double latitude, double longitude, Point out)
Deprecated.
this function is deprecated and will be removed in the next release
PointconvertInverse(double x, double y)
Deprecated.
this function is deprecated and will be removed in the next release
PointconvertInverse(double x, double y, Point out)
Deprecated.
this function is deprecated and will be removed in the next release
doubleconvertRotationAngleForward(double latitude, double longitude, double angle)
Deprecated.
this function is deprecated and will be removed in the next release
doubleconvertRotationAngleInverse(double x, double y, double angle)
Deprecated.
this function is deprecated and will be removed in the next release
doubleconvertXForward(double latitude, double longitude)
Deprecated.
this function is deprecated and will be removed in the next release
doubleconvertXInverse(double x, double y)
Deprecated.
this function is deprecated and will be removed in the next release
doubleconvertYForward(double latitude, double longitude)
Deprecated.
this function is deprecated and will be removed in the next release
doubleconvertYInverse(double x, double y)
Deprecated.
this function is deprecated and will be removed in the next release
float[]createTrajectory(double lonFrom, double latFrom, double lonTo, double latTo, int numberOfSegments)
Deprecated.
this function is deprecated and will be removed in the next release
voiddestroy() 
voiddispose()
This method is internal and shouldn't be called by user.
it may be removed/renamed in future.
voiddraw(Graphics2D g, AffineTransform xform, boolean publicOnly)
Deprecated.
this function is deprecated and will be removed in the next release
SVGElementfindSVGElement(long svgId)
This method is internal and shouldn't be called by user.
it may be removed/renamed in future.
voidfitBounds(double bottomLat, double leftLon, double topLat, double rightLon)
Make map fits specified bounds.
doublefromLengthUnits(double length, LengthUnits units)
Convert value of length measured in given units to meters
doublegetCenterLatitude()
Deprecated.
this function is deprecated and will be removed in the next release
doublegetCenterLongitude()
Deprecated.
this function is deprecated and will be removed in the next release
doublegetDistance(double latFrom, double lonFrom, double latTo, double lonTo)
Returns distance, in meters, between 2 given points
doublegetDistance(GISPoint fromPoint, GISPoint toPoint)
Returns distance, in meters, between 2 given points
doublegetDistanceByRoute(double latFrom, double lonFrom, double latTo, double lonTo)
Calculates length of route from one point to another.
doublegetDistanceByRoute(GISPoint fromPoint, GISPoint toPoint)
Calculates length of route from one point to another.
doublegetHeight()
Returns the height of the shape.
ShapeGISMap.Layer[]getLayers()
Returns the array of layers used in this GIS Map
Returned array shouldn't be modified structurally: only items can be accessed for modification
doublegetMapScale()
Deprecated.
this function is deprecated and will be removed in the next release
doublegetMaxMapScale()
Returns the maximum available scale of the map projection
doublegetMinMapScale()
Returns the minimum available scale of the map projection
doublegetMPP()
Calculates amount of meters in one pixel of map presentation
PresentablegetPresentable()
Returns the Presentable object (Agent or Experiment) where this shape belongs to, or null.
GISRoutegetRoute(double startLatitude, double startLongitude, double endLatitude, double endLongitude)
Creates an unidirectional route from one geographic point to another.
GISRoutegetRoute(double startLatitude, double startLongitude, double endLatitude, double endLongitude, boolean bidirectional)
Creates route from one geographic point to another.
GISRoutegetRoute(GISPoint start, GISPoint end)
Creates an unidirectional route from one geographic point to another.
GISRoutegetRoute(GISPoint start, GISPoint end, boolean bidirectional)
Creates route from one geographic point to another.
IGISRouteProvidergetRouteProvider()
Retrieves default route provider for all agents in GIS space.
doublegetWidth()
Returns the width of the shape.
booleanisLayerVisible(String shapeFileName)
Tests if a shapefile layer is visible
booleanisMouseNavigationEnabled()
Returns true if panning and zooming with a mouse are allowed.
static com.bbn.openmap.proj.ProjectionmakeProjection(double centerLatitude, double centerLongitude, double projectionScale, int width, int height)
Create a Mercator projection.
voidonMarkupChanged() 
voidpan(double toEast, double toNorth)
Moves the map projection center
Parameters are amounts of delta in the resulting offset
One horizontal delta is a half of longitude difference from map projection center to the west/east bound of projection
One vertical delta is a half of latitude difference from map projection center to the south/north bound of projection
voidpostSVGShapeSpecificAttributes(List<String> att, List<String> val, boolean publicOnly)
Posts general properties specific to a particular shape class.
booleanprojectionContains(double latitude, double longitude)
Deprecated.
this function is deprecated and will be removed in the next release
voidremove(GISMultiRegion markupElement)
Removes GIS markup element from drawing set of elements.
voidremove(GISMarkupElement markupElement)
Removes GIS markup element from drawing set of elements.
voidremoveImageChangedListener(ImageChangedListener listener)
Deprecated.
voidrequestRedraw()
Deprecated.
this function is deprecated and will be removed in the next release
voidresetSVGState()
This method is internal and shouldn't be called by user.
it may be removed/renamed in future.
voidrestoreOwner(Object owner)
Deprecated.
List<GISPoint>search(String query) 
List<GISNode>search(String query, boolean area, boolean visibleAreaOnly) 
GISPointsearchFirst(String query)
Search for a point on the Earth corresponding to the user's query.
GISMultiRegionsearchFirstMultiRegion(String query) 
GISRegionsearchFirstRegion(String query) 
List<GISMultiRegion>searchMultiRegion(String query) 
List<GISRegion>searchRegion(String query) 
voidsetCenterLatitude(double centerLatitude)
Sets the latitude of the map projection center, measured in degrees (-90 ...
voidsetCenterLongitude(double centerLongitude)
Sets the longitude of the map projection center, measured in degrees (-180 ...
voidsetHeight(double height)
Sets the height of the shape.
voidsetLayerVisibility(String shapeFileName, boolean visible)
Shows or hides a shapefile layer.
voidsetMapScale(double mapScale)
Sets the scale of map projection
voidsetMouseNavigationEnabled(boolean mouseNavigationEnabled)
Manage ability to pan and zoom the map with a mouse.
voidsetProjectionCenter(double centerLatitude, double centerLongitude)
Sets the center of the map projection
voidsetSearchBounds(double bottomLatitude, double leftLongitude, double topLatitude, double rigthLongitude)
Sets bounds for search area.
voidsetWidth(double width)
Sets the width of the shape.
doubletoLengthUnits(double length, LengthUnits units)
Convert value of length measured in meters to given length units
booleanupdateDynamicPropertiesStructural(boolean publicOnly) 
SVGElementupdateSVGProperties(List<SVGCommand> output, ShapeDrawMode drawMode, boolean publicOnly, SVGElement owner, SVGElement elbehind)
This method is internal and shouldn't be called by user.
it may be removed/renamed in future.
Updates SVG properties of the element that are then sent to the rendering client.
voidzoomIn()
Increases scale of map projection (x 2)
voidzoomOut()
Decreases scale of map projection (x 1/2)

Methods inherited from class com.anylogic.engine.AbstractShapeGISMap

clone, convertForward, convertInverse, formatMapScale, onClick

Methods inherited from class com.anylogic.engine.presentation.Shape3D

canHandleClick, getDrawMode, getScaleZ, getZ, getZOffset, setDrawMode, setPos, setPos, setPos, setRotation, setScale, setScale, setScaleZ, setZ

Methods inherited from class java.lang.Object

equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Methods inherited from interface com.anylogic.engine.markup.AggregatableAnimationElement

initializeInternal, postInitialize

Methods inherited from interface com.anylogic.engine.Locatable2D

getX, getY

Field Details

CLASSIC

public static final ITileURLProvider CLASSIC

GERMANSTYLE

public static final ITileURLProvider GERMANSTYLE

TRANSPORT

public static final ITileURLProvider TRANSPORT

HUMANITARIAN

public static final ITileURLProvider HUMANITARIAN

STRAIGHT

public static final AbstractGISRouteProvider STRAIGHT

Constructor Details

ShapeGISMap

public ShapeGISMap(Presentable presentable,
 ShapeDrawMode drawMode,
 boolean ispublic,
 double x,
 double y,
 double width,
 double height,
 String packagePrefix,
 ShapeGISMap.Layer[] layers,
 double centerLatitude,
 double centerLongitude,
 double mapScale,
 Color mapBorderColor,
 Color mapBackgroundColor,
 boolean showTiles,
 TileURLProviderType tileURLProviderType,
 IGISRouteProvider routeProvider,
 int precisionInMeters,
 boolean showRouteNotFoundError)
Constructs a GIS Map shape with specific attributes.
Parameters:
presentable - the presentable object owning this shape
drawMode - where to draw this shape: 2D, 3D or 2D+3D
ispublic - if true, the shape is visible on container's presentation
x - the x coordinate of the shape upper left corner
y - the y coordinate of the shape upper left corner
width - the width of the shape
height - the height of the shape
packagePrefix - the package name of original agent where this image is defined, formatted using '/' characters; with '/' character at the beginning and at the end
layers - the array of ShapeGISMap.Layer objects to be used and drawn
centerLatitude - the latitude of the map projection center, measured in degrees (-90 ... (South) ... 0 ... (North) ... +90)
centerLongitude - the longitude of the map projection center, measured in degrees (-180 ... (West) ... 0 ... (East) ... +180)
mapScale - the scale (ratio between meters on the screen and meters on the Earth surface), e.g. 1/100000 means "1 km in 1 cm"
mapBorderColor - the color of map's bounds
mapBackgroundColor - the color of map's background
showTiles - true draw tile layer
tileURLProviderType - an element of the TileURLProviderType enum provides URL for loading tile from server
routeProvider - the implementation of IGISRouteProvider interface provides route from one point to another and distance between two given points
precisionInMeters - precision measured in meters is used to simplify routes and regions
showRouteNotFoundError - affects when route is not found; true stop execution and show error; false join two points with straight line

ShapeGISMap

public ShapeGISMap(Presentable presentable,
 ShapeDrawMode drawMode,
 boolean ispublic,
 double x,
 double y,
 double width,
 double height,
 String packagePrefix,
 ShapeGISMap.Layer[] layers,
 double centerLatitude,
 double centerLongitude,
 double mapScale,
 Color mapBorderColor,
 Color mapBackgroundColor,
 boolean showTiles,
 String[] tileURLs,
 IGISRouteProvider routeProvider,
 int precisionInMeters,
 boolean showRouteNotFoundError)
Constructs a GIS Map shape with specific attributes.
Parameters:
presentable - the presentable object owning this shape
drawMode - where to draw this shape: 2D, 3D or 2D+3D
ispublic - if true, the shape is visible on container's presentation
x - the x coordinate of the shape upper left corner
y - the y coordinate of the shape upper left corner
width - the width of the shape
height - the height of the shape
packagePrefix - the package name of original agent where this image is defined, formatted using '/' characters; with '/' character at the beginning and at the end
layers - the array of ShapeGISMap.Layer objects to be used and drawn
centerLatitude - the latitude of the map projection center, measured in degrees (-90 ... (South) ... 0 ... (North) ... +90)
centerLongitude - the longitude of the map projection center, measured in degrees (-180 ... (West) ... 0 ... (East) ... +180)
mapScale - the scale (ratio between meters on the screen and meters on the Earth surface), e.g. 1/100000 means "1 km in 1 cm"
mapBorderColor - the color of map's bounds
mapBackgroundColor - the color of map's background
showTiles - true draw tile layer
tileURLs - the array of urls to load tiles from a server. Must contain "[zoom]", "[x]", "[y]" to work properly. See for details.
routeProvider - the implementation of IGISRouteProvider interface provides route from one point to another and distance between two given points
precisionInMeters - precision measured in meters is used to simplify routes and regions
showRouteNotFoundError - affects when route is not found; true stop execution and show error; false join two points with straight line

Method Details

setWidth

public void setWidth(double width)
Sets the width of the shape.
Parameters:
width - the width of the shape

getWidth

public double getWidth()
Returns the width of the shape.
Returns:
the width of the shape

setHeight

public void setHeight(double height)
Sets the height of the shape.
Parameters:
height - the height of the shape

getHeight

public double getHeight()
Returns the height of the shape.
Returns:
the height of the shape

updateDynamicPropertiesStructural

@AnyLogicInternalAPI
public boolean updateDynamicPropertiesStructural(boolean publicOnly)
Overrides:
updateDynamicPropertiesStructural in class Shape
Returns:
true if:
1. update was done (usually for visible elements, respecting public flag etc.)
AND
2. further update of structural changes is applicable

contains

public boolean contains(double px,
 double py)
Description copied from class: Shape
Test if the shape contains the point with the given coordinates (relative to this shape's container, i.e. in the same system with the coordinates of this shape, x and y)
Specified by:
contains in class Shape
Parameters:
px - the x coordinate relative to this shape's container
py - the y coordinate relative to this shape's container
Returns:
true if the shape contains the point with the given coordinates

draw

@AnyLogicInternalAPI
@Deprecated
public void draw(Graphics2D g,
 AffineTransform xform,
 boolean publicOnly)
Deprecated.
this function is deprecated and will be removed in the next release

getMapScale

@Deprecated
public double getMapScale()
Deprecated.
this function is deprecated and will be removed in the next release
Description copied from class: AbstractShapeGISMap
Returns the map scale as it was last set programmatically or at the map creation. In the Cloud mode the user may change the scale manually, and that will not be known to the model. The scale translates to GIS zoom: scale 1/500000000 is zoom 0, and scale 1/2000 is zoom 18.
Specified by:
getMapScale in class AbstractShapeGISMap
Returns:
the current scale of the map

setMapScale

public void setMapScale(double mapScale)
Description copied from class: AbstractShapeGISMap
Sets the scale of map projection
Specified by:
setMapScale in class AbstractShapeGISMap
Parameters:
mapScale - the scale (ratio between meters on the screen and meters on the Earth surface), e.g. 1/100000 means "1 km in 1 cm"

getMinMapScale

public double getMinMapScale()
Description copied from class: AbstractShapeGISMap
Returns the minimum available scale of the map projection
Specified by:
getMinMapScale in class AbstractShapeGISMap
Returns:
the minimum available scale (ratio between meters on the screen and meters on the Earth surface), e.g. 1/100000 means "1 km in 1 cm"

getMaxMapScale

public double getMaxMapScale()
Description copied from class: AbstractShapeGISMap
Returns the maximum available scale of the map projection
Specified by:
getMaxMapScale in class AbstractShapeGISMap
Returns:
the maximum available scale (ratio between meters on the screen and meters on the Earth surface), e.g. 1/100000 means "1 km in 1 cm"

zoomIn

public void zoomIn()
Description copied from class: AbstractShapeGISMap
Increases scale of map projection (x 2)
Specified by:
zoomIn in class AbstractShapeGISMap

zoomOut

public void zoomOut()
Description copied from class: AbstractShapeGISMap
Decreases scale of map projection (x 1/2)
Specified by:
zoomOut in class AbstractShapeGISMap

pan

public void pan(double toEast,
 double toNorth)
Description copied from class: AbstractShapeGISMap
Moves the map projection center
Parameters are amounts of delta in the resulting offset
One horizontal delta is a half of longitude difference from map projection center to the west/east bound of projection
One vertical delta is a half of latitude difference from map projection center to the south/north bound of projection
Specified by:
pan in class AbstractShapeGISMap
Parameters:
toEast - number of horizontal deltas to be added to the projection center, if positive, center is moved to the East, if negative - to the West
toNorth - number of vertical deltas to be added to the projection center, if positive, center is moved to the North, if negative - to the South

getCenterLatitude

@Deprecated
public double getCenterLatitude()
Deprecated.
this function is deprecated and will be removed in the next release
Description copied from class: AbstractShapeGISMap
Returns the latitude of the map projection center, measured in degrees (-90 ... (South) ... 0 ... (North) ... +90)
Specified by:
getCenterLatitude in class AbstractShapeGISMap
Returns:
the latitude of the map projection center, measured in degrees (-90 ... (South) ... 0 ... (North) ... +90)

getCenterLongitude

@Deprecated
public double getCenterLongitude()
Deprecated.
this function is deprecated and will be removed in the next release
Description copied from class: AbstractShapeGISMap
Returns the longitude of the map projection center, measured in degrees (-180 ... (West) ... 0 ... (East) ... +180)
Specified by:
getCenterLongitude in class AbstractShapeGISMap
Returns:
the longitude of the map projection center, measured in degrees (-180 ... (West) ... 0 ... (East) ... +180)

setProjectionCenter

public void setProjectionCenter(double centerLatitude,
 double centerLongitude)
Description copied from class: AbstractShapeGISMap
Sets the center of the map projection
Specified by:
setProjectionCenter in class AbstractShapeGISMap
Parameters:
centerLatitude - new latitude of the map projection center, measured in degrees (-90 ... (South) ... 0 ... (North) ... +90)
centerLongitude - new longitude of the map projection center, measured in degrees (-180 ... (West) ... 0 ... (East) ... +180)

setCenterLatitude

public void setCenterLatitude(double centerLatitude)
Description copied from class: AbstractShapeGISMap
Sets the latitude of the map projection center, measured in degrees (-90 ... (South) ... 0 ... (North) ... +90)
Specified by:
setCenterLatitude in class AbstractShapeGISMap
Parameters:
centerLatitude - new latitude of the map projection center, measured in degrees (-90 ... (South) ... 0 ... (North) ... +90)

setCenterLongitude

public void setCenterLongitude(double centerLongitude)
Description copied from class: AbstractShapeGISMap
Sets the longitude of the map projection center, measured in degrees (-180 ... (West) ... 0 ... (East) ... +180)
Specified by:
setCenterLongitude in class AbstractShapeGISMap
Parameters:
centerLongitude - new longitude of the map projection center, measured in degrees (-180 ... (West) ... 0 ... (East) ... +180)

convertXForward

@Deprecated
public double convertXForward(double latitude,
 double longitude)
Deprecated.
this function is deprecated and will be removed in the next release
Description copied from class: AbstractShapeGISMap
Creates forward projection of the given point to screen and returns x-coordinate
Specified by:
convertXForward in class AbstractShapeGISMap
Parameters:
latitude - the latitude of point, measured in degrees (-90 ... (South) ... 0 ... (North) ... +90)
longitude - the longitude of point, measured in degrees (-180 ... (West) ... 0 ... (East) ... +180)
Returns:
the x coordinate of screen-projection of the given point

convertYForward

@Deprecated
public double convertYForward(double latitude,
 double longitude)
Deprecated.
this function is deprecated and will be removed in the next release
Description copied from class: AbstractShapeGISMap
Creates forward projection of the given point to screen and returns y-coordinate
Specified by:
convertYForward in class AbstractShapeGISMap
Parameters:
latitude - the latitude of point, measured in degrees (-90 ... (South) ... 0 ... (North) ... +90)
longitude - the longitude of point, measured in degrees (-180 ... (West) ... 0 ... (East) ... +180)
Returns:
the y coordinate of screen-projection of the given point

convertForward

@Deprecated
public Point convertForward(double latitude,
 double longitude)
Deprecated.
this function is deprecated and will be removed in the next release
Description copied from class: AbstractShapeGISMap
Creates forward projection of the given point to screen and returns (x, y) coordinates
Specified by:
convertForward in class AbstractShapeGISMap
Parameters:
latitude - the latitude of point, measured in degrees (-90 ... (South) ... 0 ... (North) ... +90)
longitude - the longitude of point, measured in degrees (-180 ... (West) ... 0 ... (East) ... +180)
Returns:
the Point structure with (x, y) coordinates of screen-projection of the given point

convertForward

@Deprecated
public Point convertForward(double latitude,
 double longitude,
 Point out)
Deprecated.
this function is deprecated and will be removed in the next release
Description copied from class: AbstractShapeGISMap
Creates forward projection of the given point to screen and returns (x, y) coordinates
Specified by:
convertForward in class AbstractShapeGISMap
Parameters:
latitude - the latitude of point, measured in degrees (-90 ... (South) ... 0 ... (North) ... +90)
longitude - the longitude of point, measured in degrees (-180 ... (West) ... 0 ... (East) ... +180)
out - the Point structure to write the result to, may be null
Returns:
the Point structure with (x, y) coordinates of screen-projection of the given point

convertRotationAngleForward

@Deprecated
public double convertRotationAngleForward(double latitude,
 double longitude,
 double angle)
Deprecated.
this function is deprecated and will be removed in the next release
Description copied from class: AbstractShapeGISMap
Creates forward projection of the given rotation angle (direction) at the given point, to screen and returns rotation angle in screen coordinates
Specified by:
convertRotationAngleForward in class AbstractShapeGISMap
Parameters:
latitude - the latitude of point, measured in degrees (-90 ... (South) ... 0 ... (North) ... +90)
longitude - the longitude of point, measured in degrees (-180 ... (West) ... 0 ... (East) ... +180)
angle - the rotation angle measured in radians from East CCW (0 is East direction, PI/2 is North direction, etc.)
Returns:
the rotation angle measured in radians from model animation point (1, 0) CW around (0, 0) point (as Y-axis is directed downwards)

convertXInverse

@Deprecated
public double convertXInverse(double x,
 double y)
Deprecated.
this function is deprecated and will be removed in the next release
Description copied from class: AbstractShapeGISMap
Creates inverse projection of the given point from screen and returns longitude
Specified by:
convertXInverse in class AbstractShapeGISMap
Parameters:
x - the x coordinate of screen-projection of the given point
y - the y coordinate of screen-projection of the given point
Returns:
the longitude of point, measured in degrees (-180 ... (West) ... 0 ... (East) ... +180)

convertYInverse

@Deprecated
public double convertYInverse(double x,
 double y)
Deprecated.
this function is deprecated and will be removed in the next release
Description copied from class: AbstractShapeGISMap
Creates inverse projection of the given point from screen and returns latitude
Specified by:
convertYInverse in class AbstractShapeGISMap
Parameters:
x - the x coordinate of screen-projection of the given point
y - the y coordinate of screen-projection of the given point
Returns:
the latitude of point, measured in degrees (-90 ... (South) ... 0 ... (North) ... +90)

convertInverse

@Deprecated
public Point convertInverse(double x,
 double y)
Deprecated.
this function is deprecated and will be removed in the next release
Description copied from class: AbstractShapeGISMap
Creates inverse projection of the given point from screen and returns (latitude, longitude) coordinates
Specified by:
convertInverse in class AbstractShapeGISMap
Parameters:
x - the x coordinate of screen-projection of the given point
y - the y coordinate of screen-projection of the given point
Returns:
the Point structure with (latitude, longitude) of the point, where
latitude is measured in degrees (-90 ... (South) ... 0 ... (North) ... +90)
and longitude is measured in degrees (-180 ... (West) ... 0 ... (East) ... +180)

convertInverse

@Deprecated
public Point convertInverse(double x,
 double y,
 Point out)
Deprecated.
this function is deprecated and will be removed in the next release
Description copied from class: AbstractShapeGISMap
Creates inverse projection of the given point from screen and returns (latitude, longitude) coordinates
Specified by:
convertInverse in class AbstractShapeGISMap
Parameters:
x - the x coordinate of screen-projection of the given point
y - the y coordinate of screen-projection of the given point
out - the Point structure to write the result to, may be null
Returns:
the Point structure with (latitude, longitude) of the point, where
latitude is measured in degrees (-90 ... (South) ... 0 ... (North) ... +90)
and longitude is measured in degrees (-180 ... (West) ... 0 ... (East) ... +180)

convertRotationAngleInverse

@Deprecated
public double convertRotationAngleInverse(double x,
 double y,
 double angle)
Deprecated.
this function is deprecated and will be removed in the next release
Description copied from class: AbstractShapeGISMap
Creates inverse projection of the given rotation angle (direction) at the given point, from screen and returns rotation angle in map coordinates
Specified by:
convertRotationAngleInverse in class AbstractShapeGISMap
Parameters:
x - the x coordinate of screen-projection of the given point
y - the y coordinate of screen-projection of the given point
angle - the rotation angle measured in radians from model animation point (1, 0) CW around (0, 0) point (as Y-axis is directed downwards)
Returns:
the rotation angle measured in radians from East CCW (0 is East direction, PI/2 is North direction, etc.)

projectionContains

@Deprecated
public boolean projectionContains(double latitude,
 double longitude)
Deprecated.
this function is deprecated and will be removed in the next release
Description copied from class: AbstractShapeGISMap
Returns true if the projection of the given point to screen is visible on this map
Specified by:
projectionContains in class AbstractShapeGISMap
Parameters:
latitude - the latitude of point, measured in degrees (-90 ... (South) ... 0 ... (North) ... +90)
longitude - the longitude of point, measured in degrees (-180 ... (West) ... 0 ... (East) ... +180)
Returns:
true if the projection of the given point to screen is visible on this map

createTrajectory

@Deprecated
public float[] createTrajectory(double lonFrom,
 double latFrom,
 double lonTo,
 double latTo,
 int numberOfSegments)
Deprecated.
this function is deprecated and will be removed in the next release

getDistance

public double getDistance(double latFrom,
 double lonFrom,
 double latTo,
 double lonTo)
Description copied from class: AbstractShapeGISMap
Returns distance, in meters, between 2 given points
Specified by:
getDistance in class AbstractShapeGISMap
Parameters:
latFrom - the latitude of the 1st point, measured in degrees (-90 ... (South) ... 0 ... (North) ... +90)
lonFrom - the longitude of the 1st point, measured in degrees (-180 ... (West) ... 0 ... (East) ... +180)
latTo - the latitude of the 2nd point, measured in degrees (-90 ... (South) ... 0 ... (North) ... +90)
lonTo - the longitude of the 2nd point, measured in degrees (-180 ... (West) ... 0 ... (East) ... +180)
Returns:
the distance, in meters, between 2 given points

getDistance

public double getDistance(GISPoint fromPoint,
 GISPoint toPoint)
Description copied from class: AbstractShapeGISMap
Returns distance, in meters, between 2 given points
Specified by:
getDistance in class AbstractShapeGISMap
Parameters:
fromPoint - the 1st point on the Earth's surface
toPoint - the 2nd point on the Earth's surface
Returns:
the distance, in meters, between 2 given points

getDistanceByRoute

public double getDistanceByRoute(double latFrom,
 double lonFrom,
 double latTo,
 double lonTo)
Description copied from class: AbstractShapeGISMap
Calculates length of route from one point to another. Uses route provider to create a route.
Specified by:
getDistanceByRoute in class AbstractShapeGISMap
Parameters:
latFrom - latitude of the start point
lonFrom - longitude of the start point
latTo - latitude of the end point
lonTo - longitude of the end point
Returns:
length of route in meters

getDistanceByRoute

public double getDistanceByRoute(GISPoint fromPoint,
 GISPoint toPoint)
Description copied from class: AbstractShapeGISMap
Calculates length of route from one point to another. Uses route provider to create a route.
Specified by:
getDistanceByRoute in class AbstractShapeGISMap
Parameters:
fromPoint - the 1st point on the Earth's surface
toPoint - the 2nd point on the Earth's surface
Returns:
length of route in meters

getLayers

public ShapeGISMap.Layer[] getLayers()
Returns the array of layers used in this GIS Map
Returned array shouldn't be modified structurally: only items can be accessed for modification
Returns:
the array of layers used in this GIS Map

requestRedraw

@Deprecated
public void requestRedraw()
Deprecated.
this function is deprecated and will be removed in the next release

destroy

public void destroy()

makeProjection

@AnyLogicInternalAPI
public static com.bbn.openmap.proj.Projection makeProjection(double centerLatitude,
 double centerLongitude,
 double projectionScale,
 int width,
 int height)
Create a Mercator projection.
Parameters:
centerLatitude - the latitude of projection's center
centerLongitude - the longitude of projection's center
projectionScale - the scale for projection within the range from 0 to 1
width - the width of new projection measured in pixels
height - the height of new projection measured in pixels
Returns:
projection, or null if the projection can't be created.

getPresentable

public Presentable getPresentable()
Description copied from class: Shape
Returns the Presentable object (Agent or Experiment) where this shape belongs to, or null.
Overrides:
getPresentable in class Shape
Returns:
the Presentable that owns this shape, or null

restoreOwner

@AnyLogicInternalCodegenAPI
@Deprecated
public void restoreOwner(Object owner)
Deprecated.
Description copied from class: Shape
This method normally should not be called by user
This method restores owner of this object
The method is used in snapshot saving/loading
Specified by:
restoreOwner in interface com.anylogic.engine.internal.Child
Overrides:
restoreOwner in class Shape
Parameters:
owner - owner of this object, usually Agent, Experiment or ShapeGroup
public List<GISNode> search(String query,
 boolean area,
 boolean visibleAreaOnly)
public List<GISPoint> search(String query)

searchRegion

public List<GISRegion> searchRegion(String query)

searchMultiRegion

public List<GISMultiRegion> searchMultiRegion(String query)

searchFirst

public GISPoint searchFirst(String query)
Description copied from class: AbstractShapeGISMap
Search for a point on the Earth corresponding to the user's query.
Specified by:
searchFirst in class AbstractShapeGISMap
Parameters:
query - name of a geographic object or POI

searchFirstRegion

public GISRegion searchFirstRegion(String query)

searchFirstMultiRegion

public GISMultiRegion searchFirstMultiRegion(String query)

isLayerVisible

public boolean isLayerVisible(String shapeFileName)
Tests if a shapefile layer is visible
Parameters:
shapeFileName - the name of the shapefile
Returns:
true if the layer is visible, false if not or not found

setLayerVisibility

public void setLayerVisibility(String shapeFileName,
 boolean visible)
Shows or hides a shapefile layer.
Parameters:
shapeFileName - the name of the shapefile
visible - true to show, false to hide

getRouteProvider

public IGISRouteProvider getRouteProvider()
Description copied from class: AbstractShapeGISMap
Retrieves default route provider for all agents in GIS space.
Specified by:
getRouteProvider in class AbstractShapeGISMap
Returns:
default route provider
See Also:
IGISRouteProvider

getRoute

public GISRoute getRoute(GISPoint start,
 GISPoint end,
 boolean bidirectional)
Creates route from one geographic point to another.
Parameters:
start - point on the Earth's surface
end - point on the Earth's surface
bidirectional - true if edge of the network would be bidirectional
Returns:
route between two points

getRoute

public GISRoute getRoute(double startLatitude,
 double startLongitude,
 double endLatitude,
 double endLongitude,
 boolean bidirectional)
Creates route from one geographic point to another.
Parameters:
startLatitude - latitude of the start point
startLongitude - longitude of the start point
endLatitude - latitude of the end point
endLongitude - latitude of the end point
bidirectional - true if edge of the network would be bidirectional
Returns:
route between two points

getRoute

public GISRoute getRoute(GISPoint start,
 GISPoint end)
Description copied from class: AbstractShapeGISMap
Creates an unidirectional route from one geographic point to another.
Specified by:
getRoute in class AbstractShapeGISMap
Parameters:
start - point on the Earth's surface
end - point on the Earth's surface
Returns:
route between two points

getRoute

public GISRoute getRoute(double startLatitude,
 double startLongitude,
 double endLatitude,
 double endLongitude)
Description copied from class: AbstractShapeGISMap
Creates an unidirectional route from one geographic point to another.
Specified by:
getRoute in class AbstractShapeGISMap
Parameters:
startLatitude - latitude of the start point
startLongitude - longitude of the start point
endLatitude - latitude of the end point
endLongitude - latitude of the end point
Returns:
route between two points

addImageChangedListener

@AnyLogicInternalAPI
@Deprecated
public void addImageChangedListener(ImageChangedListener listener)
Deprecated.

removeImageChangedListener

@AnyLogicInternalAPI
@Deprecated
public void removeImageChangedListener(ImageChangedListener listener)
Deprecated.

getMPP

public double getMPP()
Description copied from class: AbstractShapeGISMap
Calculates amount of meters in one pixel of map presentation
Specified by:
getMPP in class AbstractShapeGISMap

onMarkupChanged

@AnyLogicInternalAPI
public void onMarkupChanged()

add

public void add(GISMarkupElement markupElement)
Adds GIS markup element to drawing set of elements.

remove

public void remove(GISMarkupElement markupElement)
Removes GIS markup element from drawing set of elements.

add

public void add(GISMultiRegion markupElement)
Adds GIS markup element to drawing set of elements.

remove

public void remove(GISMultiRegion markupElement)
Removes GIS markup element from drawing set of elements.

toLengthUnits

public double toLengthUnits(double length,
 LengthUnits units)
Convert value of length measured in meters to given length units
Parameters:
length - value of length
units - length units
Returns:
length measured in specified units

fromLengthUnits

public double fromLengthUnits(double length,
 LengthUnits units)
Convert value of length measured in given units to meters
Parameters:
length - value of length
units - length units
Returns:
length measured in meters

setSearchBounds

public void setSearchBounds(double bottomLatitude,
 double leftLongitude,
 double topLatitude,
 double rigthLongitude)
Sets bounds for search area.
Parameters:
bottomLat - the latitude of searchable area's bottom bound, measured in degrees (-90 ... (South) ... 0 ... (North) ... +90)
leftLon - the longitude of searchable area's left bound, measured in degrees (-180 ... (West) ... 0 ... (East) ... +180)
topLat - the latitude of searchable area's top bound, measured in degrees (-90 ... (South) ... 0 ... (North) ... +90)
rightLon - the longitude of searchable area's right bound, measured in degrees (-180 ... (West) ... 0 ... (East) ... +180)

isMouseNavigationEnabled

public boolean isMouseNavigationEnabled()
Returns true if panning and zooming with a mouse are allowed.
Returns:
true if mouse panning and zooming are allowed false otherwise

setMouseNavigationEnabled

public void setMouseNavigationEnabled(boolean mouseNavigationEnabled)
Manage ability to pan and zoom the map with a mouse.
Parameters:
mouseNavigationEnabled - true to allow mouse panning and zooming false to forbid

fitBounds

public void fitBounds(double bottomLat,
 double leftLon,
 double topLat,
 double rightLon)
Make map fits specified bounds.
Parameters:
bottomLat - the latitude of visible area's bottom bound, measured in degrees (-90 ... (South) ... 0 ... (North) ... +90)
leftLon - the longitude of visible area's left bound, measured in degrees (-180 ... (West) ... 0 ... (East) ... +180)
topLat - the latitude of visible area's top bound, measured in degrees (-90 ... (South) ... 0 ... (North) ... +90)
rightLon - the longitude of visible area's right bound, measured in degrees (-180 ... (West) ... 0 ... (East) ... +180)

updateSVGProperties

@AnyLogicInternalAPI
public SVGElement updateSVGProperties(List<SVGCommand> output,
 ShapeDrawMode drawMode,
 boolean publicOnly,
 SVGElement owner,
 SVGElement elbehind)
Description copied from interface: SVGElement
This method is internal and shouldn't be called by user.
it may be removed/renamed in future.
Updates SVG properties of the element that are then sent to the rendering client. If the element is not yet in the SVG scene, generates "C" command, if it is there, but some properties are out of date, generates "U" command. If SVG drawing of this element is not needed because of public only settings, or permanently not needed, or not supported yet, returns false and does nothing.
Specified by:
updateSVGProperties in interface SVGElement
Overrides:
updateSVGProperties in class Shape
Parameters:
output - the list of commands to add to
drawMode - TODO
publicOnly - drawing context: if true, only shapes that are marked as public only are updated
owner - the SVG element that serves as a container for this element
elbehind - the SVG element behind this one, or null if none or if order is irrelevant
Returns:
the actual owner this element has been added to or null if element is not drawn (e.g. drawing of this element is not needed because of public only settings, permanently not needed or not supported - hence SVG id is not set). The actual owner may differ from the given owner when the svg element is added to a different place (e.g. GIS map).

resetSVGState

@AnyLogicInternalAPI
public void resetSVGState()
Description copied from interface: SVGElement
This method is internal and shouldn't be called by user.
it may be removed/renamed in future.
Specified by:
resetSVGState in interface SVGElement
Overrides:
resetSVGState in class Shape

postSVGShapeSpecificAttributes

public void postSVGShapeSpecificAttributes(List<String> att,
 List<String> val,
 boolean publicOnly)
Description copied from class: Shape
Posts general properties specific to a particular shape class. Is triggered by SVG_DIRTY_SHAPE flag. Made public for occasional posting of additional SVG properties from outside engine (e.g. from libraries)
Overrides:
postSVGShapeSpecificAttributes in class Shape
Parameters:
att - attribute names
val - attribute values
publicOnly - TODO

changeViewPosition

public void changeViewPosition(double latitude,
 double longitude,
 double zoom)
Remember user changes of the map view position. These values are coming from animation.

findSVGElement

@AnyLogicInternalAPI
public SVGElement findSVGElement(long svgId)
Description copied from interface: SVGElement
This method is internal and shouldn't be called by user.
it may be removed/renamed in future.
Specified by:
findSVGElement in interface SVGElement
Overrides:
findSVGElement in class Shape

dispose

@AnyLogicInternalAPI
public void dispose()
This method is internal and shouldn't be called by user.
it may be removed/renamed in future.