class PolyDrawer
extends java.lang.Object
Polyline
and a Polygon
.
Also contains different public method for quick styling updates.Modifier and Type | Field and Description |
---|---|
private float[] |
alphas_
An array of two floats which will be factor of polygon's and polyline's transparency (in this
order), when set by calling the
set_alpha(float) method. |
private boolean |
displayed_
Indicates that the instance is actually added in the map.
|
private int |
fill_color_
ColorInt value for the (for both polygon_ drawing. |
private java.util.ArrayList<com.mapbox.mapboxsdk.geometry.LatLng> |
holes_
Points describing eventual holes;
|
private java.util.ArrayList<com.mapbox.mapboxsdk.geometry.LatLng> |
points_
Points describing this
PolyDrawer . |
private com.mapbox.mapboxsdk.annotations.Polygon |
polygon_
The
Polygon . |
private com.mapbox.mapboxsdk.annotations.Polyline |
polyline_
The
Polyline . |
private int |
stroke_color_
ColorInt value for the polyline_ drawing. |
private float |
stroke_width_
Width of the
polyline_ stroke. |
Constructor and Description |
---|
PolyDrawer(java.util.ArrayList<com.mapbox.mapboxsdk.geometry.LatLng> points,
java.util.ArrayList<com.mapbox.mapboxsdk.geometry.LatLng> holes,
int fill_color,
int stroke_color,
float stroke_width,
float[] alphas)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
private void |
apply_style() |
void |
off() |
void |
on() |
private java.util.ArrayList<com.mapbox.mapboxsdk.geometry.LatLng> |
points(boolean close)
Gets an
ArrayList of locations of this PolyDrawer . |
void |
set_alpha(float alpha)
Sets the alpha value of this
PolyDrawer . |
private final java.util.ArrayList<com.mapbox.mapboxsdk.geometry.LatLng> points_
PolyDrawer
.private final int fill_color_
ColorInt
value for the (for both polygon_
drawing.private final int stroke_color_
ColorInt
value for the polyline_
drawing.private final float stroke_width_
polyline_
stroke.private final float[] alphas_
set_alpha(float)
method.@Nullable private java.util.ArrayList<com.mapbox.mapboxsdk.geometry.LatLng> holes_
@Nullable private com.mapbox.mapboxsdk.annotations.Polygon polygon_
Polygon
.@Nullable private com.mapbox.mapboxsdk.annotations.Polyline polyline_
Polyline
.private boolean displayed_
public PolyDrawer(java.util.ArrayList<com.mapbox.mapboxsdk.geometry.LatLng> points, @Nullable java.util.ArrayList<com.mapbox.mapboxsdk.geometry.LatLng> holes, int fill_color, int stroke_color, float stroke_width, float[] alphas)
points
- An ArrayList
of LatLng
locations describing the shape of this
PolyDrawer
holes
- A list of LatLng
describing eventual holes in the base polygonfill_color
- The fill ColorInt
of this shapestroke_color
- The fill ColorInt
of this shapealphas
- An array of alpha's factors for both polygon_
and polyline_
public void on()
private java.util.ArrayList<com.mapbox.mapboxsdk.geometry.LatLng> points(boolean close)
ArrayList
of locations of this PolyDrawer
.close
- Should we close this polygon ?LatLng
.GeoUtils
private void apply_style()
public void off()
public void set_alpha(float alpha)
PolyDrawer
.alpha
- the alpha value (between 0 and 1)