
public class Polygon extends OverlayWithIW
InfoWindow (a bubble).
Mimics the Polygon class from Google Maps Android API v2 as much as possible. Main differences:| Modifier and Type | Class and Description |
|---|---|
(package private) class |
Polygon.LinearRing
inner class holding one ring: the polygon outline, or a hole inside the polygon
|
Overlay.Snappable| Modifier and Type | Field and Description |
|---|---|
protected Paint |
mFillPaint
Paint settings.
|
protected Paint |
mOutlinePaint |
mInfoWindow, mRelatedObject, mSnippet, mSubDescription, mTitleSHADOW_X_SKEW, SHADOW_Y_SCALEDEFAULT_ZOOMLEVEL_MINIMAP_DIFFERENCE, NOT_SET| Constructor and Description |
|---|
Polygon() |
Polygon(Context ctx)
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
contains(MotionEvent event)
Important note: this function returns correct results only if the Polygon has been drawn before,
and if the MapView positioning has not changed.
|
void |
draw(Canvas canvas,
MapView mapView,
boolean shadow)
Draw the overlay over the map.
|
int |
getFillColor() |
List<ArrayList<GeoPoint>> |
getHoles() |
Paint |
getOutlinePaint() |
List<GeoPoint> |
getPoints() |
int |
getStrokeColor() |
float |
getStrokeWidth() |
boolean |
isVisible() |
void |
onDetach(MapView mapView)
Override to perform clean up of resources before shutdown.
|
boolean |
onSingleTapConfirmed(MotionEvent event,
MapView mapView)
By default does nothing (
return false). |
static ArrayList<GeoPoint> |
pointsAsCircle(GeoPoint center,
double radiusInMeters)
Build a list of GeoPoint as a circle.
|
static ArrayList<IGeoPoint> |
pointsAsRect(BoundingBox rectangle)
Build a list of GeoPoint as a rectangle.
|
static ArrayList<IGeoPoint> |
pointsAsRect(BoundingBoxE6 rectangle)
Deprecated.
|
static ArrayList<IGeoPoint> |
pointsAsRect(GeoPoint center,
double lengthInMeters,
double widthInMeters)
Build a list of GeoPoint as a rectangle.
|
void |
setFillColor(int fillColor) |
void |
setHoles(List<? extends List<GeoPoint>> holes) |
void |
setPoints(List<GeoPoint> points)
This method will take a copy of the points.
|
void |
setStrokeColor(int color) |
void |
setStrokeWidth(float width) |
void |
setVisible(boolean visible) |
closeInfoWindow, getInfoWindow, getRelatedObject, getSnippet, getSubDescription, getTitle, isInfoWindowOpen, onDestroy, setInfoWindow, setRelatedObject, setSnippet, setSubDescription, setTitledrawAt, getSafeMenuId, getSafeMenuIdSequence, isEnabled, onDoubleTap, onDoubleTapEvent, onDown, onFling, onKeyDown, onKeyUp, onLongPress, onScroll, onShowPress, onSingleTapUp, onTouchEvent, onTrackballEvent, setEnabledprotected Paint mFillPaint
protected Paint mOutlinePaint
@Deprecated public Polygon(Context ctx)
Polygon() insteadpublic Polygon()
public int getFillColor()
public int getStrokeColor()
public float getStrokeWidth()
public Paint getOutlinePaint()
public boolean isVisible()
public void setFillColor(int fillColor)
public void setStrokeColor(int color)
public void setStrokeWidth(float width)
public void setVisible(boolean visible)
public static ArrayList<GeoPoint> pointsAsCircle(GeoPoint center, double radiusInMeters)
center - center of the circleradiusInMeters - @Deprecated public static ArrayList<IGeoPoint> pointsAsRect(BoundingBoxE6 rectangle)
rectangle - defined as a BoundingBoxpublic static ArrayList<IGeoPoint> pointsAsRect(BoundingBox rectangle)
rectangle - defined as a BoundingBoxpublic static ArrayList<IGeoPoint> pointsAsRect(GeoPoint center, double lengthInMeters, double widthInMeters)
center - of the rectanglelengthInMeters - on longitudewidthInMeters - on latitudepublic void draw(Canvas canvas,
MapView mapView,
boolean shadow)
Overlaypublic boolean contains(MotionEvent event)
event - public boolean onSingleTapConfirmed(MotionEvent event,
MapView mapView)
Overlayreturn false). If you handled the Event, return true
, otherwise return false. If you returned true none of the following Overlays
or the underlying MapView has the chance to handle this event.onSingleTapConfirmed in class Overlay