-
- All Implemented Interfaces:
-
org.osmdroid.views.overlay.IOverlayMenuProvider,org.osmdroid.views.util.constants.OverlayConstants
public class MinimapOverlay extends TilesOverlay
Draws a mini-map as an overlay layer. It currently uses its own MapTileProviderBasic or a tile provider supplied to it. Do NOT share a tile provider amongst multiple tile drawing overlays - it will create an under-sized cache.
Notice, this class has some problems when the parent map view is rotation enabled. See https://github.com/osmdroid/osmdroid/issues/98 for a work around
-
-
Constructor Summary
Constructors Constructor Description MinimapOverlay(Context pContext, Handler pTileRequestCompleteHandler, MapTileProviderBase pTileProvider, int pZoomDifference)Creates a MinimapOverlay with the supplied tile provider. MinimapOverlay(Context pContext, Handler pTileRequestCompleteHandler, MapTileProviderBase pTileProvider)Creates a MinimapOverlay with the supplied tile provider. MinimapOverlay(Context pContext, Handler pTileRequestCompleteHandler)Creates a MinimapOverlay that uses its own MapTileProviderBasic.
-
Method Summary
Modifier and Type Method Description voidsetTileSource(ITileSource pTileSource)intgetZoomDifference()voidsetZoomDifference(int zoomDifference)voiddraw(Canvas c, Projection pProjection)booleanonSingleTapUp(MotionEvent pEvent, MapView pMapView)By default does nothing ( {@code return false}).booleanonDoubleTap(MotionEvent pEvent, MapView pMapView)By default does nothing ( {@code return false}).booleanonLongPress(MotionEvent pEvent, MapView pMapView)By default does nothing ( {@code return false}).booleanisOptionsMenuEnabled()Can be used to signal to external callers that this Overlay should not be used for providingoption menu items. voidsetWidth(int width)Sets the width of the mini-map in pixels intgetWidth()Gets the width of the mini-map in pixels voidsetHeight(int height)Sets the height of the mini-map in pixels intgetHeight()Gets the height of the mini-map in pixels voidsetPadding(int padding)Sets the number of pixels from the lower-right corner to offset the mini-map intgetPadding()Gets the number of pixels from the lower-right corner to offset the mini-map -
Methods inherited from class org.osmdroid.views.overlay.TilesOverlay
drawTiles, getLoadingBackgroundColor, getLoadingLineColor, getMaximumZoomLevel, getMinimumZoomLevel, getTileStates, isHorizontalWrapEnabled, isVerticalWrapEnabled, onCreateOptionsMenu, onDetach, onOptionsItemSelected, onPrepareOptionsMenu, protectDisplayedTilesForCache, setColorFilter, setHorizontalWrapEnabled, setLoadingBackgroundColor, setLoadingDrawable, setLoadingLineColor, setOptionsMenuEnabled, setUseDataConnection, setVerticalWrapEnabled, useDataConnection -
Methods inherited from class org.osmdroid.views.overlay.Overlay
draw, draw, getBounds, 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
-
MinimapOverlay
MinimapOverlay(Context pContext, Handler pTileRequestCompleteHandler, MapTileProviderBase pTileProvider, int pZoomDifference)
Creates a MinimapOverlay with the supplied tile provider.- Parameters:
pContext- a contextpTileRequestCompleteHandler- a handler for the tile request complete notificationspTileProvider- a tile provider
-
MinimapOverlay
MinimapOverlay(Context pContext, Handler pTileRequestCompleteHandler, MapTileProviderBase pTileProvider)
Creates a MinimapOverlay with the supplied tile provider.- Parameters:
pContext- a contextpTileRequestCompleteHandler- a handler for the tile request complete notificationspTileProvider- a tile provider
-
MinimapOverlay
MinimapOverlay(Context pContext, Handler pTileRequestCompleteHandler)
Creates a MinimapOverlay that uses its own MapTileProviderBasic.- Parameters:
pContext- a contextpTileRequestCompleteHandler- a handler for tile request complete notifications
-
-
Method Detail
-
setTileSource
void setTileSource(ITileSource pTileSource)
-
getZoomDifference
int getZoomDifference()
-
setZoomDifference
void setZoomDifference(int zoomDifference)
-
draw
void draw(Canvas c, Projection pProjection)
-
onSingleTapUp
boolean onSingleTapUp(MotionEvent pEvent, MapView pMapView)
By default does nothing (
{@code return false}). If you handled the Event, return{@code true}, otherwise return{@code false}. If you returned{@code true}none of the following Overlaysor the underlying MapView has the chance to handle this event.
-
onDoubleTap
boolean onDoubleTap(MotionEvent pEvent, MapView pMapView)
By default does nothing (
{@code return false}). If you handled the Event, return{@code true}, otherwise return{@code false}. If you returned{@code true}none of the following Overlaysor the underlying MapView has the chance to handle this event.
-
onLongPress
boolean onLongPress(MotionEvent pEvent, MapView pMapView)
By default does nothing (
{@code return false}). If you handled the Event, return{@code true}, otherwise return{@code false}. If you returned{@code true}none of the following Overlaysor the underlying MapView has the chance to handle this event.
-
isOptionsMenuEnabled
boolean isOptionsMenuEnabled()
Can be used to signal to external callers that this Overlay should not be used for providingoption menu items.
-
setWidth
void setWidth(int width)
Sets the width of the mini-map in pixels
- Parameters:
width- the width to set in pixels
-
getWidth
int getWidth()
Gets the width of the mini-map in pixels
-
setHeight
void setHeight(int height)
Sets the height of the mini-map in pixels
- Parameters:
height- the height to set in pixels
-
getHeight
int getHeight()
Gets the height of the mini-map in pixels
-
setPadding
void setPadding(int padding)
Sets the number of pixels from the lower-right corner to offset the mini-map
- Parameters:
padding- the padding to set in pixels
-
getPadding
int getPadding()
Gets the number of pixels from the lower-right corner to offset the mini-map
-
-
-
-