-
- All Implemented Interfaces:
-
org.osmdroid.views.util.constants.OverlayConstants
public abstract class PolyOverlayWithIW extends OverlayWithIW
Repository of common methods for Polyline and Polygon
-
-
Method Summary
Modifier and Type Method Description voidusePath(boolean pUsePath)voidsetVisible(boolean visible)booleanisVisible()PaintgetOutlinePaint()List<PaintList>getOutlinePaintLists()assuming if someone uses this method, someone wants to use Listinstead of mere Paint voidsetGeodesic(boolean geodesic)Sets whether to draw each segment of the line as a geodesic or not.Warning: it takes effect only if set before setting the points in the Polyline. booleanisGeodesic()voidsetInfoWindow(InfoWindow infoWindow)Set the InfoWindow to be used.Default is a BasicInfoWindow, with the layout named "bonuspack_bubble".You can use this method either to use your own layout, or to use your own sub-class of InfoWindow.If you don't want any InfoWindow to open, you can set it to null. voidshowInfoWindow()Show the infowindow, if any. voidsetInfoWindowLocation(GeoPoint location)Sets the info window anchor point to a geopoint location GeoPointgetInfoWindowLocation()voidsetMilestoneManagers(List<MilestoneManager> pMilestoneManagers)doublegetDistance()voiddraw(Canvas pCanvas, Projection pProjection)voidonDetach(MapView mapView)Override to perform clean up of resources before shutdown. BoundingBoxgetBounds()voidsetPoints(List<GeoPoint> points)voidaddPoint(GeoPoint p)List<GeoPoint>getActualPoints()voidsetDowngradeDisplay(boolean pDowngradeDisplay)voidsetDowngradePixelSizes(int pPolySize, int pRectangleSize)voidsetDensityMultiplier(float pDensityMultiplier)booleancontains(MotionEvent pEvent)Used to be if Polygon Important note: this function returns correct results only if the Poly has been drawn before,and if the MapView positioning has not changed. booleanisCloseTo(GeoPoint pPoint, double pTolerance, MapView pMapView)GeoPointgetCloseTo(GeoPoint pPoint, double pTolerance, MapView pMapView)booleanonSingleTapConfirmed(MotionEvent pEvent, MapView pMapView)Used to be in both Polyline and Polygon Default listener for a single tap event on a Poly:set the infowindow at the tapped position, and open the infowindow (if any). -
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
-
-
Method Detail
-
usePath
void usePath(boolean pUsePath)
-
setVisible
void setVisible(boolean visible)
-
isVisible
boolean isVisible()
-
getOutlinePaint
Paint getOutlinePaint()
-
getOutlinePaintLists
List<PaintList> getOutlinePaintLists()
assuming if someone uses this method, someone wants to use Listinstead of mere Paint
-
setGeodesic
void setGeodesic(boolean geodesic)
Sets whether to draw each segment of the line as a geodesic or not.Warning: it takes effect only if set before setting the points in the Polyline.
-
isGeodesic
boolean isGeodesic()
-
setInfoWindow
void setInfoWindow(InfoWindow infoWindow)
Set the InfoWindow to be used.Default is a BasicInfoWindow, with the layout named "bonuspack_bubble".You can use this method either to use your own layout, or to use your own sub-class of InfoWindow.If you don't want any InfoWindow to open, you can set it to null.
-
showInfoWindow
void showInfoWindow()
Show the infowindow, if any. It will be opened either at the latest location, if any,or to a default location computed by setDefaultInfoWindowLocation method.Note that you can manually set this location with: setInfoWindowLocation
-
setInfoWindowLocation
void setInfoWindowLocation(GeoPoint location)
Sets the info window anchor point to a geopoint location
-
getInfoWindowLocation
GeoPoint getInfoWindowLocation()
-
setMilestoneManagers
void setMilestoneManagers(List<MilestoneManager> pMilestoneManagers)
-
getDistance
double getDistance()
-
draw
void draw(Canvas pCanvas, Projection pProjection)
-
onDetach
void onDetach(MapView mapView)
Override to perform clean up of resources before shutdown. By default does nothing.
-
getBounds
BoundingBox getBounds()
-
getActualPoints
List<GeoPoint> getActualPoints()
-
setDowngradeDisplay
void setDowngradeDisplay(boolean pDowngradeDisplay)
-
setDowngradePixelSizes
void setDowngradePixelSizes(int pPolySize, int pRectangleSize)
- Parameters:
pPolySize- Size in pixels below which we will display an optimized list of segmentspRectangleSize- Size in pixels below which we will display a mere rectangle (faster);supposed to be lower than pPolySize
-
setDensityMultiplier
void setDensityMultiplier(float pDensityMultiplier)
-
contains
boolean contains(MotionEvent pEvent)
Used to be if Polygon Important note: this function returns correct results only if the Poly has been drawn before,and if the MapView positioning has not changed.
-
isCloseTo
boolean isCloseTo(GeoPoint pPoint, double pTolerance, MapView pMapView)
- Parameters:
pTolerance- in pixels
-
getCloseTo
GeoPoint getCloseTo(GeoPoint pPoint, double pTolerance, MapView pMapView)
- Parameters:
pTolerance- in pixels
-
onSingleTapConfirmed
boolean onSingleTapConfirmed(MotionEvent pEvent, MapView pMapView)
-
-
-
-