public class PolygonBuilder
extends java.lang.Object
Polygon
objects.Modifier and Type | Field and Description |
---|---|
static float |
MAX_BORDER_WIDTH |
static float |
MIN_BORDER_WIDTH |
Constructor and Description |
---|
PolygonBuilder() |
Modifier and Type | Method and Description |
---|---|
PolygonBuilder |
add(double latitude,
double longitude)
Adds a vertex to the end of the polygon being built.
|
PolygonBuilder |
add(GeoPoint point)
Adds a vertex to the end of the polygon being built.
|
PolygonBuilder |
add(android.location.Location location)
Adds a vertex to the end of the polygon being built.
|
PolygonBuilder |
addAll(java.util.Collection<? extends GeoPoint> points)
Adds multiple vertices to the end of the polygon being built.
|
PolygonBuilder |
addAll(double[] points)
Adds multiple vertices to the end of the polygon being built.
|
PolygonBuilder |
borderColor(int color)
Sets the border color of the polygon as a 32-bit ARGB color.
|
PolygonBuilder |
borderWidth(float width)
Sets the border width of the polygon.
|
Polygon |
build()
Combines all the properties that have been set and returns a new
Polygon object. |
PolygonBuilder |
fillColor(int color)
Sets the fill color of the polygon as a 32-bit ARGB color.
|
int |
getBorderColor()
Gets the border color for this object.
|
float |
getBorderWidth()
Gets the border width for this object.
|
int |
getFillColor()
Gets the border color for this object.
|
java.util.List<GeoPoint> |
getPoints()
Gets the point set of geocoordinates for this object.
|
int |
getTextureAlpha()
Gets the texture alpha of this object.
|
int |
getTextureId()
Gets the texture resource ID of this object.
|
int |
getZIndex()
Gets the zIndex of this object.
|
boolean |
isSelectable()
Gets the selectability setting for this object.
|
boolean |
isVisible()
Gets the visibility setting for this object.
|
PolygonBuilder |
selectable(boolean isSelectable)
Specifies the selectability for the polygon.
|
PolygonBuilder |
texture(android.content.Context context,
int resId)
Specifies a texture to fill polygon with.
|
PolygonBuilder |
textureAlpha(int textureAlpha)
Specifies a transparency for polygon texture.
|
PolygonBuilder |
visibility(boolean isVisible)
Specifies the visibility for the polygon.
|
PolygonBuilder |
zIndex(int zIndex)
Specifies the zIndex of the polygon.
|
public static final float MIN_BORDER_WIDTH
public static final float MAX_BORDER_WIDTH
public PolygonBuilder add(android.location.Location location)
location
- A geographic location.public PolygonBuilder add(double latitude, double longitude)
latitude
- Latitude, in degrees.longitude
- Longitude, in degrees.public PolygonBuilder add(GeoPoint point)
point
- A pair of latitude and longitude in degrees.public PolygonBuilder addAll(java.util.Collection<? extends GeoPoint> points)
points
- Collections of GeoPoints.public PolygonBuilder addAll(double[] points) throws java.lang.IllegalArgumentException
points
- the array of geocoordinates. Lat1, lon1, lat2, lon2, etc.
For example, new double[]{ 52.375426f, 4.908740f, 52.375292f, 4.909346f}
.{@link
- IllegalArgumentException} when invalid coordinates are encountered.java.lang.IllegalArgumentException
public PolygonBuilder borderColor(int color)
color
- The ARGB color.public PolygonBuilder fillColor(int color)
color
- The ARGB color.public PolygonBuilder borderWidth(float width) throws java.lang.IllegalArgumentException
public PolygonBuilder visibility(boolean isVisible)
isVisible
- The visibility of polygon.public PolygonBuilder selectable(boolean isSelectable)
isSelectable
- Whether the polygon is selectable.public PolygonBuilder zIndex(int zIndex)
zIndex
- the zIndex of the polygon.public PolygonBuilder texture(android.content.Context context, int resId) throws java.lang.IllegalArgumentException
context
- a Context of the application.resId
- a drawable's resource id.java.lang.IllegalArgumentException
- when context is null.public PolygonBuilder textureAlpha(int textureAlpha)
texture(Context, int).
textureAlpha
- The transparency value in the range [0, 255]. Values out of range will be clamped.public java.util.List<GeoPoint> getPoints()
public int getBorderColor()
public int getFillColor()
public float getBorderWidth()
public boolean isVisible()
public boolean isSelectable()
public int getZIndex()
public int getTextureId()
public int getTextureAlpha()