AnyLogic
Expand
Font size
All Implemented Interfaces:
Serializable
Enclosing class:
ShapeGISMap

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

Constructor Summary

ConstructorDescription
Layer(String shapeFileName, String dbfFileName, Color lineColor, Color fillColor, int objectNameColumnIndex, boolean visible)
Creates new Layer descriptor

Method Summary

Modifier and TypeMethodDescription
com.bbn.openmap.layer.shape.areas.PoliticalAreafindPoliticalArea(double latitude, double longitude)
Deprecated.
will be removed in the next release
com.bbn.openmap.layer.shape.areas.PoliticalAreafindPoliticalArea(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.AreaShapeLayergetLayerObject()
Deprecated.
will be removed in the next release
com.bbn.openmap.omGraphics.OMGraphicListgetObjects(double latitude, double longitude)
Deprecated.
will be removed in the next release
com.bbn.openmap.omGraphics.OMGraphicListgetObjects(String objectName)
Deprecated.
will be removed in the next release
Collection<com.bbn.openmap.layer.shape.areas.PoliticalArea>getPoliticalAreas()
Deprecated.
will be removed in the next release
booleanisVisible() 
voidsetFillColor(List<Integer> shapes, Color color)
Sets the new fill color for the given shapes in the shape file.
voidsetLineColor(List<Integer> shapes, Color color)
Sets the new line color for the given shapes in the shape file.
voidsetVisible(boolean visible) 

Methods inherited from class java.lang.Object

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

Constructor Details

Layer

public Layer(String shapeFileName,
 String dbfFileName,
 Color lineColor,
 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 Details

getPoliticalAreas

@Deprecated
public 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(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(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(List<Integer> shapes,
 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(List<Integer> shapes,
 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