AnyLogic
Expand
Font size
  • java.lang.Object
    • com.anylogic.engine.presentation.ShapeGISMap.Layer
All Implemented Interfaces:
java.io.Serializable
Enclosing class:
ShapeGISMap

public static class ShapeGISMap.Layer
extends java.lang.Object
implements java.io.Serializable
Class which stores GIS map layer information
Author:
AnyLogic North America, LLC https://anylogic.com
See Also:
Serialized Form

Constructor Summary

Constructors 
Layer​(java.lang.String shapeFileName, java.lang.String dbfFileName, java.awt.Color lineColor, java.awt.Color fillColor, int objectNameColumnIndex, boolean visible)
Creates new Layer descriptor
Constructor Description

Method Summary

All Methods Instance Methods Concrete Methods Deprecated Methods 
com.bbn.openmap.layer.shape.areas.PoliticalArea findPoliticalArea​(double latitude, double longitude)
Deprecated.
will be removed in the next release
com.bbn.openmap.layer.shape.areas.PoliticalArea findPoliticalArea​(java.lang.String identifier)
Deprecated.
will be removed in the next release
com.bbn.openmap.layer.shape.areas.PoliticalArea[] findPoliticalAreas​(double latitude, double longitude)
Deprecated.
will be removed in the next release
com.bbn.openmap.layer.shape.areas.AreaShapeLayer getLayerObject()
Deprecated.
will be removed in the next release
com.bbn.openmap.omGraphics.OMGraphicList getObjects​(double latitude, double longitude)
Deprecated.
will be removed in the next release
com.bbn.openmap.omGraphics.OMGraphicList getObjects​(java.lang.String objectName)
Deprecated.
will be removed in the next release
java.util.Collection<com.bbn.openmap.layer.shape.areas.PoliticalArea> getPoliticalAreas()
Deprecated.
will be removed in the next release
boolean isVisible()  
void setFillColor​(java.util.List<java.lang.Integer> shapes, java.awt.Color color)
Sets the new fill color for the given shapes in the shape file.
void setLineColor​(java.util.List<java.lang.Integer> shapes, java.awt.Color color)
Sets the new line color for the given shapes in the shape file.
void setVisible​(boolean visible)  
Modifier and Type Method Description

Methods inherited from class java.lang.Object

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

Constructor Detail

Layer

public Layer​(java.lang.String shapeFileName,
             java.lang.String dbfFileName,
             java.awt.Color lineColor,
             java.awt.Color fillColor,
             int objectNameColumnIndex,
             boolean visible)
Creates new Layer descriptor
Parameters:
shapeFileName - GIS Map Shape file name (.shp) with shapes of the layer
dbfFileName - DBF file name with descriptions of GIS Map Shape file objects
lineColor - default line color for objects in this layer
fillColor - default fill color for objects in this layer
objectNameColumnIndex - the index of the object-name column in .dbf file

Method Detail

getPoliticalAreas

@Deprecated
public java.util.Collection<com.bbn.openmap.layer.shape.areas.PoliticalArea> getPoliticalAreas()
Deprecated.
will be removed in the next release
Returns the collection of all political areas located in this layer
Political areas are usually defined in DBF file
Each PoliticalArea has its identifier and human-readable name and may contain several shapes on the map (e.g. islands)
PoliticalArea has methods for tuning its presentation on the map, e.g. changing fill color.
Returns:
the collection of all political areas located in this layer

findPoliticalArea

@Deprecated
public com.bbn.openmap.layer.shape.areas.PoliticalArea findPoliticalArea​(java.lang.String identifier)
Deprecated.
will be removed in the next release
Finds political area by its string identifier
Parameters:
identifier - the identifier of political area
Returns:
the political area with given identifier or null

findPoliticalAreas

@Deprecated
public com.bbn.openmap.layer.shape.areas.PoliticalArea[] findPoliticalAreas​(double latitude,
                                                                            double longitude)
Deprecated.
will be removed in the next release
Returns PoliticalArea objects of this layer located at the given 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 array with PoliticalArea objects of this layer located at the given coordinates (empty array if no political areas were found)

findPoliticalArea

@Deprecated
public com.bbn.openmap.layer.shape.areas.PoliticalArea findPoliticalArea​(double latitude,
                                                                         double longitude)
Deprecated.
will be removed in the next release
Returns (if there are several objects at the same point, returns one of them)
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 PoliticalArea object of this layer located at the given coordinates (null if no political areas were found)

getObjects

@Deprecated
public com.bbn.openmap.omGraphics.OMGraphicList getObjects​(double latitude,
                                                           double longitude)
Deprecated.
will be removed in the next release
Returns new OMGraphicsList with objects of this layer located at the given 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:
new OMGraphicsList with objects of this layer located at the given coordinates

getObjects

@Deprecated
public com.bbn.openmap.omGraphics.OMGraphicList getObjects​(java.lang.String objectName)
Deprecated.
will be removed in the next release
Returns new OMGraphicsList with objects of this layer having name objectName
Parameters:
objectName - the name of objects to be returned
Returns:
new OMGraphicsList with objects of this layer having name objectName

getLayerObject

@Deprecated
public com.bbn.openmap.layer.shape.areas.AreaShapeLayer getLayerObject()
Deprecated.
will be removed in the next release
Returns OpenMap layer object associated with this Layer
Returns:
the OpenMap layer object associated with this Layer

isVisible

public boolean isVisible()

setVisible

public void setVisible​(boolean visible)

setLineColor

public void setLineColor​(java.util.List<java.lang.Integer> shapes,
                         java.awt.Color color)
Sets the new line color for the given shapes in the shape file. WARNING: This is a temporary API, it may be replaced in the future versions.
Parameters:
shapes - the list of shape indices, 0-based
color - the new line color

setFillColor

public void setFillColor​(java.util.List<java.lang.Integer> shapes,
                         java.awt.Color color)
Sets the new fill color for the given shapes in the shape file. WARNING: This is a temporary API, it may be replaced in the future versions.
Parameters:
shapes - the list of shape indices, 0-based
color - the new fill color
How can we improve this article?