-
- All Implemented Interfaces:
-
org.osmdroid.views.util.constants.OverlayConstants
public class Polygon extends PolyOverlayWithIW
A polygon on the earth's surface that can have a popup-org.osmdroid.views.overlay.infowindow.InfoWindow (a bubble).
Mimics the Polygon class from Google Maps Android API v2 as much as possible. Main differences:- Doesn't support: Z-Index, Geodesic mode- Supports InfoWindow.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfacePolygon.OnClickListener
-
Method Summary
Modifier and Type Method Description intgetFillColor()intgetStrokeColor()floatgetStrokeWidth()PaintgetFillPaint()List<GeoPoint>getPoints()voidsetFillColor(int fillColor)voidsetStrokeColor(int color)voidsetStrokeWidth(float width)voidsetHoles(List<out List<GeoPoint>> holes)List<List<GeoPoint>>getHoles()returns a copy of the holes this polygon contains 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(GeoPoint center, double lengthInMeters, double widthInMeters)Build a list of GeoPoint as a rectangle. voidonDetach(MapView mapView)Override to perform clean up of resources before shutdown. booleanonClickDefault(Polygon polygon, MapView mapView, GeoPoint eventPos)default behaviour when no click listener is set voidsetOnClickListener(Polygon.OnClickListener listener)-
Methods inherited from class org.osmdroid.views.overlay.PolyOverlayWithIW
addPoint, contains, draw, getActualPoints, getBounds, getCloseTo, getDistance, getInfoWindowLocation, getOutlinePaint, getOutlinePaintLists, isCloseTo, isGeodesic, isVisible, onSingleTapConfirmed, setDensityMultiplier, setDowngradeDisplay, setDowngradePixelSizes, setGeodesic, setInfoWindow, setInfoWindowLocation, setMilestoneManagers, setPoints, setVisible, showInfoWindow, usePath -
Methods inherited from class org.osmdroid.views.overlay.OverlayWithIW
closeInfoWindow, getId, getInfoWindow, getRelatedObject, getSnippet, getSubDescription, getTitle, isInfoWindowOpen, onDestroy, setId, setRelatedObject, setSnippet, setSubDescription, setTitle -
Methods inherited from class org.osmdroid.views.overlay.Overlay
draw, isEnabled, onDetach, onDoubleTap, onDoubleTapEvent, onDown, onFling, onKeyDown, onKeyUp, onLongPress, onPause, onResume, onScroll, onShowPress, onSingleTapConfirmed, onSingleTapUp, onTouchEvent, onTrackballEvent, setEnabled -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
Polygon
Polygon()
-
Polygon
Polygon(MapView mapView)
-
-
Method Detail
-
getFillColor
@Deprecated() int getFillColor()
-
getStrokeColor
@Deprecated() int getStrokeColor()
-
getStrokeWidth
@Deprecated() float getStrokeWidth()
-
getFillPaint
Paint getFillPaint()
-
getPoints
@Deprecated() List<GeoPoint> getPoints()
-
setFillColor
@Deprecated() void setFillColor(int fillColor)
-
setStrokeColor
@Deprecated() void setStrokeColor(int color)
-
setStrokeWidth
@Deprecated() void setStrokeWidth(float width)
-
pointsAsCircle
static ArrayList<GeoPoint> pointsAsCircle(GeoPoint center, double radiusInMeters)
Build a list of GeoPoint as a circle.
- Parameters:
center- center of the circle
-
pointsAsRect
static ArrayList<IGeoPoint> pointsAsRect(BoundingBox rectangle)
Build a list of GeoPoint as a rectangle.
- Parameters:
rectangle- defined as a BoundingBox
-
pointsAsRect
static ArrayList<IGeoPoint> pointsAsRect(GeoPoint center, double lengthInMeters, double widthInMeters)
Build a list of GeoPoint as a rectangle.
- Parameters:
center- of the rectanglelengthInMeters- on longitudewidthInMeters- on latitude
-
onDetach
void onDetach(MapView mapView)
Override to perform clean up of resources before shutdown. By default does nothing.
-
onClickDefault
boolean onClickDefault(Polygon polygon, MapView mapView, GeoPoint eventPos)
default behaviour when no click listener is set
-
setOnClickListener
void setOnClickListener(Polygon.OnClickListener listener)
-
-
-
-