Package com.navmii.sdk.map
Class GeoPolygon
java.lang.Object
com.navmii.sdk.map.GeoObject
com.navmii.sdk.map.GeoPolygon
public final class GeoPolygon extends GeoObject
-
Constructor Summary
Constructors Constructor Description GeoPolygon(MapRectangle mapRectangle)
Creates a polygon from the specified MapRectangle.GeoPolygon(java.util.List<MapCoordinates> vertices)
Creates a polygon from the specified vertices. -
Method Summary
Modifier and Type Method Description void
addHole(java.util.List<MapCoordinates> hole)
Adds a hole, as an array of coordinates, to the polygon.void
addVertex(int index, MapCoordinates vertex)
Inserts the specified vertex at the specified index.void
addVertex(MapCoordinates vertex)
Appends the specified vertex to the list of vertices.int
getFillColor()
int
getHoleCount()
java.util.List<java.util.List<MapCoordinates>>
getHoles()
Returns a copy of the holes of this polygon.int
getStrokeColor()
float
getStrokeWidth()
int
getVertexCount()
java.util.List<MapCoordinates>
getVertices()
Returns a copy of the vertices of this polygon.void
removeAllHoles()
Removes all holes added to the polygon.void
removeAllVertices()
Clears the list of vertices.void
removeHole(int index)
Removes the hole at the specified index.void
removeLastVertex()
Removes the last vertex from the list of vertices.void
removeVertex(int index)
Removes the vertex at the specified index.void
setFillColor(int color)
void
setHoles(java.util.List<java.util.List<MapCoordinates>> holes)
void
setStrokeColor(int color)
void
setStrokeWidth(float width)
void
setVertexPosition(int index, MapCoordinates vertex)
Changes the position of the specified vertex.void
setVertices(java.util.List<MapCoordinates> vertices)
-
Constructor Details
-
GeoPolygon
Creates a polygon from the specified vertices.- Parameters:
vertices
- The vertices of the polygon.
-
GeoPolygon
Creates a polygon from the specified MapRectangle.- Parameters:
mapRectangle
- The map rectangle.
-
-
Method Details
-
getStrokeWidth
public float getStrokeWidth()- Returns:
- The stroke width in dp units.
-
setStrokeWidth
public void setStrokeWidth(float width)- Parameters:
width
- The stroke width in dp units.
-
getStrokeColor
public int getStrokeColor()- Returns:
- The stroke color represented as a packed int (AARRGGBB).
-
setStrokeColor
public void setStrokeColor(int color)- Parameters:
color
- The stroke color represented as a packed int (AARRGGBB).
-
getFillColor
public int getFillColor()- Returns:
- The fill color represented as a packed int (AARRGGBB).
-
setFillColor
public void setFillColor(int color)- Parameters:
color
- The fill color represented as a packed int (AARRGGBB).
-
getVertices
Returns a copy of the vertices of this polygon.- Returns:
- A copy of the vertices.
-
setVertices
- Parameters:
vertices
- The new vertices for this polygon.
-
addVertex
Appends the specified vertex to the list of vertices.- Parameters:
vertex
- The vertex to append.
-
addVertex
Inserts the specified vertex at the specified index.- Parameters:
index
- The index.vertex
- The vertex to insert.
-
setVertexPosition
Changes the position of the specified vertex.- Parameters:
index
- The index.vertex
- The new position.
-
removeVertex
public void removeVertex(int index)Removes the vertex at the specified index.- Parameters:
index
- The index.
-
removeLastVertex
public void removeLastVertex()Removes the last vertex from the list of vertices. -
removeAllVertices
public void removeAllVertices()Clears the list of vertices. -
getVertexCount
public int getVertexCount()- Returns:
- The number of vertices.
-
addHole
Adds a hole, as an array of coordinates, to the polygon.- Parameters:
hole
- The list of vertices of the hole.
-
removeHole
public void removeHole(int index)Removes the hole at the specified index. Holes are indexed in the order they were added.- Parameters:
index
- The index of the hole.
-
removeAllHoles
public void removeAllHoles()Removes all holes added to the polygon. -
setHoles
- Parameters:
holes
- The new holes for this polygon.
-
getHoles
Returns a copy of the holes of this polygon.- Returns:
- A copy of the holes.
-
getHoleCount
public int getHoleCount()- Returns:
- The number of holes.
-