Package com.anylogic.engine
- Field Summary
- Constructor Summary
- Method Summary
- 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
- Constructor Details
- Method Details
- convertXForward
- convertYForward
- convertForward
- convertForward
- convertForward
- convertRotationAngleForward
- convertXInverse
- convertYInverse
- convertInverse
- convertInverse
- convertInverse
- convertRotationAngleInverse
- projectionContains
- getDistance
- getDistance
- onClick
- zoomOut
- zoomIn
- setMapScale
- getMaxMapScale
- getMinMapScale
- getMapScale
- formatMapScale
- setProjectionCenter
- setCenterLongitude
- setCenterLatitude
- getCenterLongitude
- getCenterLatitude
- pan
- clone
- getRouteProvider
- searchFirst
- getDistanceByRoute
- getDistanceByRoute
- getRoute
- getRoute
- getMPP
- java.lang.Object
- com.anylogic.engine.presentation.Shape
- com.anylogic.engine.presentation.Shape3D
- com.anylogic.engine.AbstractShapeGISMap
- All Implemented Interfaces:
com.anylogic.engine.internal.Child
,Locatable2D
,Locatable3D
,AggregatableAnimationElement
,HasLevel
,LevelElement
,SVGElement
,Serializable
,Cloneable
- Direct Known Subclasses:
ShapeGISMap
public abstract class AbstractShapeGISMap extends Shape3D
GIS map projection manager and map renderer class
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)
ShapeGISMap
class)- Author:
- AnyLogic North America, LLC https://anylogic.com
- See Also:
- Serialized Form
Constructor | Description |
---|---|
AbstractShapeGISMap() |
Modifier and Type | Method | Description |
---|---|---|
final AbstractShapeGISMap | clone() |
Cloning of GIS is not supported
(Other shapes except controls and charts allow cloning) This method throws UnsupportedOperationException if called |
abstract Point | convertForward |
Deprecated.
this function is deprecated and will be removed in the next release
|
abstract 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
|
abstract Point | convertInverse |
Deprecated.
this function is deprecated and will be removed in the next release
|
abstract 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
|
abstract double | convertRotationAngleForward |
Deprecated.
this function is deprecated and will be removed in the next release
|
abstract double | convertRotationAngleInverse |
Deprecated.
this function is deprecated and will be removed in the next release
|
abstract double | convertXForward |
Deprecated.
this function is deprecated and will be removed in the next release
|
abstract double | convertXInverse |
Deprecated.
this function is deprecated and will be removed in the next release
|
abstract double | convertYForward |
Deprecated.
this function is deprecated and will be removed in the next release
|
abstract double | convertYInverse |
Deprecated.
this function is deprecated and will be removed in the next release
|
String | formatMapScale() |
Returns a string "1:k" (e.g.
|
abstract double | getCenterLatitude() |
Deprecated.
this function is deprecated and will be removed in the next release
|
abstract double | getCenterLongitude() |
Deprecated.
this function is deprecated and will be removed in the next release
|
abstract double | getDistance |
Returns distance, in meters, between 2 given points
|
abstract double | getDistance |
Returns distance, in meters, between 2 given points
|
abstract double | getDistanceByRoute |
Calculates length of route from one point to another.
|
abstract double | getDistanceByRoute |
Calculates length of route from one point to another.
|
abstract double | getMapScale() |
Deprecated.
this function is deprecated and will be removed in the next release
|
abstract double | getMaxMapScale() |
Returns the maximum available scale of the map projection
|
abstract double | getMinMapScale() |
Returns the minimum available scale of the map projection
|
abstract double | getMPP() |
Calculates amount of meters in one pixel of map presentation
|
abstract GISRoute | getRoute |
Creates an unidirectional route from one geographic point to another.
|
abstract GISRoute | getRoute |
Creates an unidirectional route from one geographic point to another.
|
abstract IGISRouteProvider | getRouteProvider() |
Retrieves default route provider for all agents in GIS space.
|
boolean | onClick |
Should be overridden to define the shape reaction on mouse click.
|
abstract 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 |
abstract boolean | projectionContains |
Deprecated.
this function is deprecated and will be removed in the next release
|
abstract GISPoint | searchFirst |
Search for a point on the Earth corresponding to the user's query.
|
abstract void | setCenterLatitude |
Sets the latitude of the map projection center, measured in degrees (-90
...
|
abstract void | setCenterLongitude |
Sets the longitude of the map projection center, measured in degrees
(-180 ...
|
abstract void | setMapScale |
Sets the scale of map projection
|
abstract void | setProjectionCenter |
Sets the center of the map projection
|
abstract void | zoomIn() |
Increases scale of map projection (
x 2 ) |
abstract void | zoomOut() |
Decreases scale of map projection (
x 1/2 ) |
canHandleClick, getDrawMode, getScaleZ, getZ, getZOffset, setDrawMode, setPos, setPos, setPos, setRotation, setScale, setScale, setScaleZ, setZ
contains, executeUserAction, findSVGElement, getGroup, getLevel, getName, getPresentable, getRotation, getScaleX, getScaleY, getSVGId, getX, getY, isJava2DSwingPresentation, isPublic_xjal, isSVGPresentation, isVisible, onAggregatorVisibilityChanged, postSVGShapeSpecificAttributes, randomPointInside, randomPointInside, removeSVGFromOwner, removeSVGImage, resetSVGState, restoreOwner, setLevel, setPublic_xjal, setScale, setScaleX, setScaleY, setVisible, setX, setY, updateDynamicProperties, updateDynamicPropertiesStructural, updateSVGProperties
public AbstractShapeGISMap()
@Deprecated public abstract double convertXForward(double latitude, double longitude)
Deprecated.
this function is deprecated and will be removed in the next release
Creates forward projection of the given point to screen and returns
x-coordinate
- 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 abstract double convertYForward(double latitude, double longitude)
Deprecated.
this function is deprecated and will be removed in the next release
Creates forward projection of the given point to screen and returns
y-coordinate
- 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 abstract Point convertForward(double latitude, double longitude)
Deprecated.
this function is deprecated and will be removed in the next release
Creates forward projection of the given point to screen and returns
(x, y) coordinates
- 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 abstract Point convertForward(double latitude, double longitude, Point out)
Deprecated.
this function is deprecated and will be removed in the next release
Creates forward projection of the given point to screen and returns
(x, y) coordinates
- 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 Point convertForward(Point latLon)
Deprecated.
this function is deprecated and will be removed in the next release
Creates forward projection of the given point to screen and returns
(x, y) coordinates. The
z
of returned point
isn't changed (it equals the given point).- Parameters:
latLon
- the (latitude, longitude) of point, where
latitude is measured in degrees (-90 ... (South) ... 0 ... (North) ... +90) and longitude is 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 abstract double convertRotationAngleForward(double latitude, double longitude, double angle)
Deprecated.
this function is deprecated and will be removed in the next release
Creates forward projection of the given rotation angle (direction) at the
given point, to screen and returns rotation angle in screen coordinates
- 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 abstract double convertXInverse(double x, double y)
Deprecated.
this function is deprecated and will be removed in the next release
Creates inverse projection of the given point from screen and returns
longitude
- 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 abstract double convertYInverse(double x, double y)
Deprecated.
this function is deprecated and will be removed in the next release
Creates inverse projection of the given point from screen and returns
latitude
- 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 abstract Point convertInverse(double x, double y)
Deprecated.
this function is deprecated and will be removed in the next release
Creates inverse projection of the given point from screen and returns
(latitude, longitude) coordinates
- 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 abstract Point convertInverse(double x, double y, Point out)
Deprecated.
this function is deprecated and will be removed in the next release
Creates inverse projection of the given point from screen and returns
(latitude, longitude) coordinates
- 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 Point convertInverse(Point xy)
Deprecated.
this function is deprecated and will be removed in the next release
Creates inverse projection of the given point from screen and returns
(latitude, longitude) coordinates. The
z
of returned point
isn't changed (it equals the given point).- Parameters:
xy
- the (x, y) coordinates of screen-projection of the given point- Returns:
- the new 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 abstract double convertRotationAngleInverse(double x, double y, double angle)
Deprecated.
this function is deprecated and will be removed in the next release
Creates inverse projection of the given rotation angle (direction) at the
given point, from screen and returns rotation angle in map coordinates
- 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 abstract boolean projectionContains(double latitude, double longitude)
Deprecated.
this function is deprecated and will be removed in the next release
Returns
true
if the projection of the given point to
screen is visible on this map- 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
public abstract double getDistance(double latFrom, double lonFrom, double latTo, double lonTo)
Returns distance, in meters, between 2 given points
- 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 abstract double getDistance(GISPoint fromPoint, GISPoint toPoint)
Returns distance, in meters, between 2 given points
- 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
@AnyLogicInternalCodegenAPI public boolean onClick(double latitude, double longitude)
Should be overridden to define the shape reaction on mouse click. The
click coordinates are geographical coordinates, obtained via
inverse-projection of mouse click (which is definitely within the shape
bounds) if this method is called. By default, does nothing and returns
false
.- Overrides:
onClick
in classShape
- Parameters:
latitude
- the latitude of point, measured in degrees (-90 ... (South) ... 0 ... (North) ... +90), where mouse click occurredlongitude
- the longitude of point, measured in degrees (-180 ... (West) ... 0 ... (East) ... +180), where mouse click occurred- Returns:
- always return
false
here.
public abstract void zoomOut()
Decreases scale of map projection (
x 1/2
)public abstract void zoomIn()
Increases scale of map projection (
x 2
)public abstract void setMapScale(double mapScale)
Sets the scale of map projection
- 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 abstract double getMaxMapScale()
Returns the maximum available scale of the map projection
- 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 abstract double getMinMapScale()
Returns the minimum available scale of the map projection
- 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"
@Deprecated public abstract double getMapScale()
Deprecated.
this function is deprecated and will be removed in the next release
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.
- Returns:
- the current scale of the map
public String formatMapScale()
Returns a string "1:k" (e.g. "1:100000") for map with scale 1/k
- Returns:
- the string representation of map scale
public abstract void setProjectionCenter(double centerLatitude, double centerLongitude)
Sets the center of the map projection
- 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 abstract void setCenterLongitude(double centerLongitude)
Sets the longitude of the map projection center, measured in degrees
(-180 ... (West) ... 0 ... (East) ... +180)
- Parameters:
centerLongitude
- new longitude of the map projection center, measured in degrees (-180 ... (West) ... 0 ... (East) ... +180)
public abstract void setCenterLatitude(double centerLatitude)
Sets the latitude of the map projection center, measured in degrees (-90
... (South) ... 0 ... (North) ... +90)
- Parameters:
centerLatitude
- new latitude of the map projection center, measured in degrees (-90 ... (South) ... 0 ... (North) ... +90)
@Deprecated public abstract double getCenterLongitude()
Deprecated.
this function is deprecated and will be removed in the next release
Returns the longitude of the map projection center, measured in degrees
(-180 ... (West) ... 0 ... (East) ... +180)
- Returns:
- the longitude of the map projection center, measured in degrees (-180 ... (West) ... 0 ... (East) ... +180)
@Deprecated public abstract double getCenterLatitude()
Deprecated.
this function is deprecated and will be removed in the next release
Returns the latitude of the map projection center, measured in degrees
(-90 ... (South) ... 0 ... (North) ... +90)
- Returns:
- the latitude of the map projection center, measured in degrees (-90 ... (South) ... 0 ... (North) ... +90)
public abstract void pan(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
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:
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
public final AbstractShapeGISMap clone()
Cloning of GIS is not supported
(Other shapes except controls and charts allow cloning)
This method throws
(Other shapes except controls and charts allow cloning)
This method throws
UnsupportedOperationException
if calledpublic abstract IGISRouteProvider getRouteProvider()
Retrieves default route provider for all agents in GIS space.
- Returns:
- default route provider
- See Also:
-
IGISRouteProvider
public abstract GISPoint searchFirst(String query)
Search for a point on the Earth corresponding to the user's query.
- Parameters:
query
- name of a geographic object or POI
public abstract double getDistanceByRoute(GISPoint fromPoint, GISPoint toPoint)
Calculates length of route from one point to another.
Uses route provider to create a route.
- 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 abstract double getDistanceByRoute(double latFrom, double lonFrom, double latTo, double lonTo)
Calculates length of route from one point to another.
Uses route provider to create a route.
- 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 abstract GISRoute getRoute(GISPoint start, GISPoint end)
Creates an unidirectional route from one geographic point to another.
- Parameters:
start
- point on the Earth's surfaceend
- point on the Earth's surface- Returns:
- route between two points
public abstract GISRoute getRoute(double startLatitude, double startLongitude, double endLatitude, double endLongitude)
Creates an unidirectional 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 point- Returns:
- route between two points
@AnyLogicInternalAPI public abstract double getMPP()
Calculates amount of meters in one pixel of map presentation