Package com.anylogic.engine.presentation
- Nested Class Summary
- Field Summary
- Constructor Summary
- Method Summary
- Methods inherited from class com.anylogic.engine.AbstractShapeGISMap
- Methods inherited from class com.anylogic.engine.presentation.Shape3D
- Methods inherited from class com.anylogic.engine.presentation.Shape
- Methods inherited from class java.lang.Object
- Methods inherited from interface com.anylogic.engine.markup.AggregatableAnimationElement
- Methods inherited from interface com.anylogic.engine.Locatable2D
- Field Details
- Constructor Details
- Method Details
- setWidth
- getWidth
- setHeight
- getHeight
- updateDynamicPropertiesStructural
- contains
- draw
- getMapScale
- setMapScale
- getMinMapScale
- getMaxMapScale
- zoomIn
- zoomOut
- pan
- getCenterLatitude
- getCenterLongitude
- setProjectionCenter
- setCenterLatitude
- setCenterLongitude
- convertXForward
- convertYForward
- convertForward
- convertForward
- convertRotationAngleForward
- convertXInverse
- convertYInverse
- convertInverse
- convertInverse
- convertRotationAngleInverse
- projectionContains
- createTrajectory
- getDistance
- getDistance
- getDistanceByRoute
- getDistanceByRoute
- getLayers
- requestRedraw
- destroy
- makeProjection
- getPresentable
- restoreOwner
- search
- search
- searchRegion
- searchMultiRegion
- searchFirst
- searchFirstRegion
- searchFirstMultiRegion
- isLayerVisible
- setLayerVisibility
- getRouteProvider
- getRoute
- getRoute
- getRoute
- getRoute
- addImageChangedListener
- removeImageChangedListener
- getMPP
- onMarkupChanged
- add
- remove
- add
- remove
- toLengthUnits
- fromLengthUnits
- setSearchBounds
- isMouseNavigationEnabled
- setMouseNavigationEnabled
- fitBounds
- updateSVGProperties
- resetSVGState
- postSVGShapeSpecificAttributes
- changeViewPosition
- findSVGElement
- dispose
- java.lang.Object
- com.anylogic.engine.presentation.Shape
- com.anylogic.engine.presentation.Shape3D
- com.anylogic.engine.AbstractShapeGISMap
- com.anylogic.engine.presentation.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
This class provides several projection methods
GIS map is a
Shape
and it can be placed on the model animation: it
renders the associated map projection on the screenThis 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)
- Author:
- AnyLogic North America, LLC https://anylogic.com
- See Also:
- Serialized Form
Modifier and Type | Class | Description |
---|---|---|
static class | ShapeGISMap.Layer |
Class which stores GIS map layer information
|
Modifier and Type | Field | Description |
---|---|---|
static final ITileURLProvider | CLASSIC | |
static final ITileURLProvider | GERMANSTYLE | |
static final ITileURLProvider | HUMANITARIAN | |
static final AbstractGISRouteProvider | STRAIGHT | |
static final ITileURLProvider | TRANSPORT |
Constructor | Description |
---|---|
ShapeGISMap |
Constructs a GIS Map shape with specific attributes.
|
ShapeGISMap |
Constructs a GIS Map shape with specific attributes.
|
Modifier and Type | Method | Description |
---|---|---|
void | add |
Adds GIS markup element to drawing set of elements.
|
void | add |
Adds GIS markup element to drawing set of elements.
|
void | addImageChangedListener |
Deprecated.
|
void | changeViewPosition |
Remember user changes of the map view position.
|
boolean | contains |
Test if the shape contains the point with the given coordinates
(relative to this shape's container, i.e.
|
Point | convertForward |
Deprecated.
this function is deprecated and will be removed in the next release
|
Point | convertForward |
Deprecated.
this function is deprecated and will be removed in the next release
|
Point | convertInverse |
Deprecated.
this function is deprecated and will be removed in the next release
|
Point | convertInverse |
Deprecated.
this function is deprecated and will be removed in the next release
|
double | convertRotationAngleForward |
Deprecated.
this function is deprecated and will be removed in the next release
|
double | convertRotationAngleInverse |
Deprecated.
this function is deprecated and will be removed in the next release
|
double | convertXForward |
Deprecated.
this function is deprecated and will be removed in the next release
|
double | convertXInverse |
Deprecated.
this function is deprecated and will be removed in the next release
|
double | convertYForward |
Deprecated.
this function is deprecated and will be removed in the next release
|
double | convertYInverse |
Deprecated.
this function is deprecated and will be removed in the next release
|
float[] | createTrajectory |
Deprecated.
this function is deprecated and will be removed in the next release
|
void | destroy() | |
void | dispose() |
This method is internal and shouldn't be called by user.
it may be removed/renamed in future. |
void | draw |
Deprecated.
this function is deprecated and will be removed in the next release
|
SVGElement | findSVGElement |
This method is internal and shouldn't be called by user.
it may be removed/renamed in future. |
void | fitBounds |
Make map fits specified bounds.
|
double | fromLengthUnits |
Convert value of length measured in given units to meters
|
double | getCenterLatitude() |
Deprecated.
this function is deprecated and will be removed in the next release
|
double | getCenterLongitude() |
Deprecated.
this function is deprecated and will be removed in the next release
|
double | getDistance |
Returns distance, in meters, between 2 given points
|
double | getDistance |
Returns distance, in meters, between 2 given points
|
double | getDistanceByRoute |
Calculates length of route from one point to another.
|
double | getDistanceByRoute |
Calculates length of route from one point to another.
|
double | getHeight() |
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 |
double | getMapScale() |
Deprecated.
this function is deprecated and will be removed in the next release
|
double | getMaxMapScale() |
Returns the maximum available scale of the map projection
|
double | getMinMapScale() |
Returns the minimum available scale of the map projection
|
double | getMPP() |
Calculates amount of meters in one pixel of map presentation
|
Presentable | getPresentable() |
Returns the Presentable object (
Agent or Experiment ) where
this shape belongs to, or null. |
GISRoute | getRoute |
Creates an unidirectional route from one geographic point to another.
|
GISRoute | getRoute |
Creates route from one geographic point to another.
|
GISRoute | getRoute |
Creates an unidirectional route from one geographic point to another.
|
GISRoute | getRoute |
Creates route from one geographic point to another.
|
IGISRouteProvider | getRouteProvider() |
Retrieves default route provider for all agents in GIS space.
|
double | getWidth() |
Returns the width of the shape.
|
boolean | isLayerVisible |
Tests if a shapefile layer is visible
|
boolean | isMouseNavigationEnabled() |
Returns
true if panning and zooming with a mouse are allowed. |
static com.bbn.openmap.proj.Projection | makeProjection |
Create a Mercator projection.
|
void | onMarkupChanged() | |
void | pan |
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 |
void | postSVGShapeSpecificAttributes |
Posts general properties specific to a particular shape class.
|
boolean | projectionContains |
Deprecated.
this function is deprecated and will be removed in the next release
|
void | remove |
Removes GIS markup element from drawing set of elements.
|
void | remove |
Removes GIS markup element from drawing set of elements.
|
void | removeImageChangedListener |
Deprecated.
|
void | requestRedraw() |
Deprecated.
this function is deprecated and will be removed in the next release
|
void | resetSVGState() |
This method is internal and shouldn't be called by user.
it may be removed/renamed in future. |
void | restoreOwner |
Deprecated.
|
List<GISPoint> | search | |
List<GISNode> | search | |
GISPoint | searchFirst |
Search for a point on the Earth corresponding to the user's query.
|
GISMultiRegion | searchFirstMultiRegion | |
GISRegion | searchFirstRegion | |
List<GISMultiRegion> | searchMultiRegion | |
List<GISRegion> | searchRegion | |
void | setCenterLatitude |
Sets the latitude of the map projection center, measured in degrees (-90
...
|
void | setCenterLongitude |
Sets the longitude of the map projection center, measured in degrees
(-180 ...
|
void | setHeight |
Sets the height of the shape.
|
void | setLayerVisibility |
Shows or hides a shapefile layer.
|
void | setMapScale |
Sets the scale of map projection
|
void | setMouseNavigationEnabled |
Manage ability to pan and zoom the map with a mouse.
|
void | setProjectionCenter |
Sets the center of the map projection
|
void | setSearchBounds |
Sets bounds for search area.
|
void | setWidth |
Sets the width of the shape.
|
double | toLengthUnits |
Convert value of length measured in meters to given length units
|
boolean | updateDynamicPropertiesStructural | |
SVGElement | updateSVGProperties |
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. |
void | zoomIn() |
Increases scale of map projection (
x 2 ) |
void | zoomOut() |
Decreases scale of map projection (
x 1/2 ) |
canHandleClick, getDrawMode, getScaleZ, getZ, getZOffset, setDrawMode, setPos, setPos, setPos, setRotation, setScale, setScale, setScaleZ, setZ
executeUserAction, getGroup, getLevel, getName, getRotation, getScaleX, getScaleY, getSVGId, getX, getY, isJava2DSwingPresentation, isPublic_xjal, isSVGPresentation, isVisible, onAggregatorVisibilityChanged, randomPointInside, randomPointInside, removeSVGFromOwner, removeSVGImage, setLevel, setPublic_xjal, setScale, setScaleX, setScaleY, setVisible, setX, setY, updateDynamicProperties
public static final ITileURLProvider CLASSIC
public static final ITileURLProvider GERMANSTYLE
public static final ITileURLProvider TRANSPORT
public static final ITileURLProvider HUMANITARIAN
public static final AbstractGISRouteProvider STRAIGHT
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 shapedrawMode
- where to draw this shape: 2D, 3D or 2D+3Dispublic
- iftrue
, the shape is visible on container's presentationx
- the x coordinate of the shape upper left cornery
- the y coordinate of the shape upper left cornerwidth
- the width of the shapeheight
- the height of the shapepackagePrefix
- the package name of original agent where this image is defined, formatted using '/' characters; with '/' character at the beginning and at the endlayers
- the array ofShapeGISMap.Layer
objects to be used and drawncenterLatitude
- 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 boundsmapBackgroundColor
- the color of map's backgroundshowTiles
-true
draw tile layertileURLProviderType
- an element of theTileURLProviderType
enum provides URL for loading tile from serverrouteProvider
- the implementation of IGISRouteProvider interface provides route from one point to another and distance between two given pointsprecisionInMeters
- precision measured in meters is used to simplify routes and regionsshowRouteNotFoundError
- affects when route is not found;true
stop execution and show error;false
join two points with straight line
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 shapedrawMode
- where to draw this shape: 2D, 3D or 2D+3Dispublic
- iftrue
, the shape is visible on container's presentationx
- the x coordinate of the shape upper left cornery
- the y coordinate of the shape upper left cornerwidth
- the width of the shapeheight
- the height of the shapepackagePrefix
- the package name of original agent where this image is defined, formatted using '/' characters; with '/' character at the beginning and at the endlayers
- the array ofShapeGISMap.Layer
objects to be used and drawncenterLatitude
- 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 boundsmapBackgroundColor
- the color of map's backgroundshowTiles
-true
draw tile layertileURLs
- 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 pointsprecisionInMeters
- precision measured in meters is used to simplify routes and regionsshowRouteNotFoundError
- affects when route is not found;true
stop execution and show error;false
join two points with straight line
public void setWidth(double width)
Sets the width of the shape.
- Parameters:
width
- the width of the shape
public double getWidth()
Returns the width of the shape.
- Returns:
- the width of the shape
public void setHeight(double height)
Sets the height of the shape.
- Parameters:
height
- the height of the shape
public double getHeight()
Returns the height of the shape.
- Returns:
- the height of the shape
@AnyLogicInternalAPI public boolean updateDynamicPropertiesStructural(boolean publicOnly)
- Overrides:
updateDynamicPropertiesStructural
in classShape
- Returns:
true
if:
1. update was done (usually for visible elements, respecting public flag etc.)
AND
2. further update of structural changes is applicable
public boolean contains(double px, double py)
Description copied from class:
Shape
@AnyLogicInternalAPI @Deprecated public void draw(Graphics2D g, AffineTransform xform, boolean publicOnly)
Deprecated.
this function is deprecated and will be removed in the next release
@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 classAbstractShapeGISMap
- Returns:
- the current scale of the map
public void setMapScale(double mapScale)
Description copied from class:
AbstractShapeGISMap
Sets the scale of map projection
- Specified by:
setMapScale
in classAbstractShapeGISMap
- 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"
public double getMinMapScale()
Description copied from class:
AbstractShapeGISMap
Returns the minimum available scale of the map projection
- Specified by:
getMinMapScale
in classAbstractShapeGISMap
- 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"
public double getMaxMapScale()
Description copied from class:
AbstractShapeGISMap
Returns the maximum available scale of the map projection
- Specified by:
getMaxMapScale
in classAbstractShapeGISMap
- 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"
public void zoomIn()
Description copied from class:
AbstractShapeGISMap
Increases scale of map projection (
x 2
)- Specified by:
zoomIn
in classAbstractShapeGISMap
public void zoomOut()
Description copied from class:
AbstractShapeGISMap
Decreases scale of map projection (
x 1/2
)- Specified by:
zoomOut
in classAbstractShapeGISMap
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
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 classAbstractShapeGISMap
- 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 WesttoNorth
- number of vertical deltas to be added to the projection center, if positive, center is moved to the North, if negative - to the South
@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 classAbstractShapeGISMap
- Returns:
- the latitude of the map projection center, measured in degrees (-90 ... (South) ... 0 ... (North) ... +90)
@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 classAbstractShapeGISMap
- Returns:
- the longitude of the map projection center, measured in degrees (-180 ... (West) ... 0 ... (East) ... +180)
public void setProjectionCenter(double centerLatitude, double centerLongitude)
Description copied from class:
AbstractShapeGISMap
Sets the center of the map projection
- Specified by:
setProjectionCenter
in classAbstractShapeGISMap
- 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)
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 classAbstractShapeGISMap
- Parameters:
centerLatitude
- new latitude of the map projection center, measured in degrees (-90 ... (South) ... 0 ... (North) ... +90)
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 classAbstractShapeGISMap
- Parameters:
centerLongitude
- new longitude of the map projection center, measured in degrees (-180 ... (West) ... 0 ... (East) ... +180)
@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 classAbstractShapeGISMap
- 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
@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 classAbstractShapeGISMap
- 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
@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 classAbstractShapeGISMap
- 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
@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 classAbstractShapeGISMap
- 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 benull
- Returns:
- the Point structure with (x, y) coordinates of screen-projection of the given point
@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 classAbstractShapeGISMap
- 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)
@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 classAbstractShapeGISMap
- Parameters:
x
- the x coordinate of screen-projection of the given pointy
- the y coordinate of screen-projection of the given point- Returns:
- the longitude of point, measured in degrees (-180 ... (West) ... 0 ... (East) ... +180)
@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 classAbstractShapeGISMap
- Parameters:
x
- the x coordinate of screen-projection of the given pointy
- the y coordinate of screen-projection of the given point- Returns:
- the latitude of point, measured in degrees (-90 ... (South) ... 0 ... (North) ... +90)
@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 classAbstractShapeGISMap
- Parameters:
x
- the x coordinate of screen-projection of the given pointy
- 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)
@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 classAbstractShapeGISMap
- Parameters:
x
- the x coordinate of screen-projection of the given pointy
- the y coordinate of screen-projection of the given pointout
- the Point structure to write the result to, may benull
- 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)
@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 classAbstractShapeGISMap
- Parameters:
x
- the x coordinate of screen-projection of the given pointy
- the y coordinate of screen-projection of the given pointangle
- 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.)
@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 classAbstractShapeGISMap
- 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
@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
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 classAbstractShapeGISMap
- 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
public double getDistance(GISPoint fromPoint, GISPoint toPoint)
Description copied from class:
AbstractShapeGISMap
Returns distance, in meters, between 2 given points
- Specified by:
getDistance
in classAbstractShapeGISMap
- Parameters:
fromPoint
- the 1st point on the Earth's surfacetoPoint
- the 2nd point on the Earth's surface- Returns:
- the distance, in meters, between 2 given points
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 classAbstractShapeGISMap
- Parameters:
latFrom
- latitude of the start pointlonFrom
- longitude of the start pointlatTo
- latitude of the end pointlonTo
- longitude of the end point- Returns:
- length of route in meters
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 classAbstractShapeGISMap
- Parameters:
fromPoint
- the 1st point on the Earth's surfacetoPoint
- the 2nd point on the Earth's surface- Returns:
- length of route in meters
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
Returned array shouldn't be modified structurally: only items can be accessed for modification
- Returns:
- the array of layers used in this GIS Map
@Deprecated public void requestRedraw()
Deprecated.
this function is deprecated and will be removed in the next release
public void destroy()
@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 centercenterLongitude
- the longitude of projection's centerprojectionScale
- the scale for projection within the range from 0 to 1width
- the width of new projection measured in pixelsheight
- the height of new projection measured in pixels- Returns:
- projection, or null if the projection can't be created.
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 classShape
- Returns:
- the Presentable that owns this shape, or null
@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
This method restores owner of this object
The method is used in snapshot saving/loading
- Specified by:
restoreOwner
in interfacecom.anylogic.engine.internal.Child
- Overrides:
restoreOwner
in classShape
- Parameters:
owner
- owner of this object, usuallyAgent
,Experiment
orShapeGroup
public List<GISNode> search(String query, boolean area, boolean visibleAreaOnly)
public List<GISPoint> search(String query)
public List<GISRegion> searchRegion(String query)
public List<GISMultiRegion> searchMultiRegion(String query)
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 classAbstractShapeGISMap
- Parameters:
query
- name of a geographic object or POI
public GISRegion searchFirstRegion(String query)
public GISMultiRegion searchFirstMultiRegion(String query)
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
public void setLayerVisibility(String shapeFileName, boolean visible)
Shows or hides a shapefile layer.
- Parameters:
shapeFileName
- the name of the shapefilevisible
- true to show, false to hide
public IGISRouteProvider getRouteProvider()
Description copied from class:
AbstractShapeGISMap
Retrieves default route provider for all agents in GIS space.
- Specified by:
getRouteProvider
in classAbstractShapeGISMap
- Returns:
- default route provider
- See Also:
-
IGISRouteProvider
public GISRoute getRoute(GISPoint start, GISPoint end, boolean bidirectional)
Creates route from one geographic point to another.
- Parameters:
start
- point on the Earth's surfaceend
- point on the Earth's surfacebidirectional
-true
if edge of the network would be bidirectional- Returns:
- route between two points
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 pointstartLongitude
- longitude of the start pointendLatitude
- latitude of the end pointendLongitude
- latitude of the end pointbidirectional
-true
if edge of the network would be bidirectional- Returns:
- route between two points
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 classAbstractShapeGISMap
- Parameters:
start
- point on the Earth's surfaceend
- point on the Earth's surface- Returns:
- route between two points
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 classAbstractShapeGISMap
- Parameters:
startLatitude
- latitude of the start pointstartLongitude
- longitude of the start pointendLatitude
- latitude of the end pointendLongitude
- latitude of the end point- Returns:
- route between two points
@AnyLogicInternalAPI @Deprecated public void addImageChangedListener(ImageChangedListener listener)
Deprecated.
@AnyLogicInternalAPI @Deprecated public void removeImageChangedListener(ImageChangedListener listener)
Deprecated.
public double getMPP()
Description copied from class:
AbstractShapeGISMap
Calculates amount of meters in one pixel of map presentation
- Specified by:
getMPP
in classAbstractShapeGISMap
@AnyLogicInternalAPI public void onMarkupChanged()
public void add(GISMarkupElement markupElement)
Adds GIS markup element to drawing set of elements.
public void remove(GISMarkupElement markupElement)
Removes GIS markup element from drawing set of elements.
public void add(GISMultiRegion markupElement)
Adds GIS markup element to drawing set of elements.
public void remove(GISMultiRegion markupElement)
Removes GIS markup element from drawing set of elements.
public double toLengthUnits(double length, LengthUnits units)
Convert value of length measured in meters to given length units
- Parameters:
length
- value of lengthunits
- length units- Returns:
- length measured in specified units
public double fromLengthUnits(double length, LengthUnits units)
Convert value of length measured in given units to meters
- Parameters:
length
- value of lengthunits
- length units- Returns:
- length measured in meters
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)
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)
@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.
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 interfaceSVGElement
- Overrides:
updateSVGProperties
in classShape
- Parameters:
output
- the list of commands to add todrawMode
- TODOpublicOnly
- drawing context: if true, only shapes that are marked as public only are updatedowner
- the SVG element that serves as a container for this elementelbehind
- 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 givenowner
when the svg element is added to a different place (e.g. GIS map).
@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.
it may be removed/renamed in future.
- Specified by:
resetSVGState
in interfaceSVGElement
- Overrides:
resetSVGState
in classShape
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 classShape
- Parameters:
att
- attribute namesval
- attribute valuespublicOnly
- TODO
public void changeViewPosition(double latitude, double longitude, double zoom)
Remember user changes of the map view position. These values are coming from animation.
@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.
it may be removed/renamed in future.
- Specified by:
findSVGElement
in interfaceSVGElement
- Overrides:
findSVGElement
in classShape
@AnyLogicInternalAPI public void dispose()
This method is internal and shouldn't be called by user.
it may be removed/renamed in future.
it may be removed/renamed in future.