|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.xj.anylogic.engine.presentation.Shape
com.xj.anylogic.engine.AbstractShapeGISMap
public abstract class AbstractShapeGISMap
GIS map projection manager and map renderer class
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:
ShapeGISMap class)
| Field Summary |
|---|
| Fields inherited from class com.xj.anylogic.engine.presentation.Shape |
|---|
UNKNOWN_NAME |
| Constructor Summary | |
|---|---|
AbstractShapeGISMap()
|
|
| Method Summary | |
|---|---|
AbstractShapeGISMap |
clone()
Cloning of GIS is not supported (Other shapes except controls and charts allow cloning) This method throws UnsupportedOperationException if called |
abstract double |
convertRotationAngleForward(double longitude,
double latitude,
double angle)
Creates forward projection of the given rotation angle (direction) at the given point, to screen and returns rotation angle in screen coordinates |
abstract double |
convertXForward(double longitude,
double latitude)
Creates forward projection of the given point to screen and returns x-coordinate |
abstract double |
convertYForward(double longitude,
double latitude)
Creates forward projection of the given point to screen and returns y-coordinate |
java.lang.String |
formatMapScale()
Returns a string "1:k" (e.g. "1:100000") for map with scale 1/k |
abstract double |
getCenterLatitude()
Returns the latitude of the map projection center, measured in degrees (-90 ... |
abstract double |
getCenterLongitude()
Returns the longitude of the map projection center, measured in degrees (-180 ... |
abstract double |
getDistance(double lonFrom,
double latFrom,
double lonTo,
double latTo)
Returns distance, in meters, between 2 given points |
abstract double |
getMapScale()
Returns the scale of map projection |
abstract double |
getMaxMapScale()
Returns the maximum available scale of the map projection |
abstract double |
getMinMapScale()
Returns the minimum available scale of the map projection |
boolean |
onClick(double longitude,
double latitude)
Should be overridden to define the shape reaction on mouse click. |
abstract void |
pan(int toEast,
int 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 |
abstract boolean |
projectionContains(double longitude,
double latitude)
Returns true if the projection of the given point to
screen is visible on this map |
abstract void |
setCenterLatitude(double centerLatitude)
Sets the latitude of the map projection center, measured in degrees (-90 ... |
abstract void |
setCenterLongitude(double centerLongitude)
Sets the longitude of the map projection center, measured in degrees (-180 ... |
abstract void |
setMapScale(double mapScale)
Sets the scale of map projection |
void |
setProjectionCenter(double centerLongitude,
double centerLatitude)
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) |
| Methods inherited from class com.xj.anylogic.engine.presentation.Shape |
|---|
canHandleClick, contains, draw, getGroup, getName, getPresentable, getRotation, getScaleX, getScaleY, getX, getY, isVisible, onClickAt, restoreOwner, setPos, setRotation, setScale, setScale, setScaleX, setScaleY, setVisible, setX, setY |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AbstractShapeGISMap()
| Method Detail |
|---|
public abstract double convertXForward(double longitude,
double latitude)
longitude - the longitude of point, measured in degrees (-180 ... (West)
... 0 ... (East) ... +180)latitude - the latitude of point, measured in degrees (-90 ... (South)
... 0 ... (North) ... +90)
public abstract double convertYForward(double longitude,
double latitude)
longitude - the longitude of point, measured in degrees (-180 ... (West)
... 0 ... (East) ... +180)latitude - the latitude of point, measured in degrees (-90 ... (South)
... 0 ... (North) ... +90)
public abstract double convertRotationAngleForward(double longitude,
double latitude,
double angle)
longitude - the longitude of point, measured in degrees (-180 ... (West)
... 0 ... (East) ... +180)latitude - the latitude of point, measured in degrees (-90 ... (South)
... 0 ... (North) ... +90)angle - the rotation angle measured in radians from East CCW (0
is East direction, PI/2 is North direction,
etc.)
public abstract boolean projectionContains(double longitude,
double latitude)
true if the projection of the given point to
screen is visible on this map
longitude - the longitude of point, measured in degrees (-180 ... (West)
... 0 ... (East) ... +180)latitude - the latitude of point, measured in degrees (-90 ... (South)
... 0 ... (North) ... +90)
true if the projection of the given point to
screen is visible on this map
public abstract double getDistance(double lonFrom,
double latFrom,
double lonTo,
double latTo)
lonFrom - the longitude of the 1st point, measured in
degrees (-180 ... (West) ... 0 ... (East) ... +180)latFrom - the latitude of the 1st point, measured in
degrees (-90 ... (South) ... 0 ... (North) ... +90)lonTo - the longitude of the 2nd point, measured in
degrees (-180 ... (West) ... 0 ... (East) ... +180)latTo - the latitude of the 2nd point, measured in
degrees (-90 ... (South) ... 0 ... (North) ... +90)
public boolean onClick(double longitude,
double latitude)
onClick in class Shapelongitude - the longitude of point, measured in degrees (-180 ... (West)
... 0 ... (East) ... +180), where mouse click occurredlatitude - the latitude of point, measured in degrees (-90 ... (South)
... 0 ... (North) ... +90), where mouse click occurred
public abstract void zoomOut()
x 1/2)
public abstract void zoomIn()
x 2)
public abstract void setMapScale(double mapScale)
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()
public abstract double getMinMapScale()
public abstract double getMapScale()
public java.lang.String formatMapScale()
public void setProjectionCenter(double centerLongitude,
double centerLatitude)
centerLongitude - new longitude of the map projection center, measured in
degrees (-180 ... (West) ... 0 ... (East) ... +180)centerLatitude - new latitude of the map projection center, measured in degrees
(-90 ... (South) ... 0 ... (North) ... +90)public abstract void setCenterLongitude(double centerLongitude)
centerLongitude - new longitude of the map projection center, measured in
degrees (-180 ... (West) ... 0 ... (East) ... +180)public abstract void setCenterLatitude(double centerLatitude)
centerLatitude - new latitude of the map projection center, measured in degrees
(-90 ... (South) ... 0 ... (North) ... +90)public abstract double getCenterLongitude()
public abstract double getCenterLatitude()
public abstract void pan(int toEast,
int toNorth)
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 Southpublic final AbstractShapeGISMap clone()
UnsupportedOperationException if called
clone in class Shape
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||