Package 

Class Polygon

  • 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.

    • Method Summary

      Modifier and Type Method Description
      int getFillColor()
      int getStrokeColor()
      float getStrokeWidth()
      Paint getFillPaint()
      List<GeoPoint> getPoints()
      void setFillColor(int fillColor)
      void setStrokeColor(int color)
      void setStrokeWidth(float width)
      void setHoles(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.
      void onDetach(MapView mapView) Override to perform clean up of resources before shutdown.
      boolean onClickDefault(Polygon polygon, MapView mapView, GeoPoint eventPos) default behaviour when no click listener is set
      void setOnClickListener(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