Package 

Class MinimapOverlay

  • 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

    • Method Summary

      Modifier and Type Method Description
      void setTileSource(ITileSource pTileSource)
      int getZoomDifference()
      void setZoomDifference(int zoomDifference)
      void draw(Canvas c, Projection pProjection)
      boolean onSingleTapUp(MotionEvent pEvent, MapView pMapView) By default does nothing ({@code return false}).
      boolean onDoubleTap(MotionEvent pEvent, MapView pMapView) By default does nothing ({@code return false}).
      boolean onLongPress(MotionEvent pEvent, MapView pMapView) By default does nothing ({@code return false}).
      boolean isOptionsMenuEnabled() Can be used to signal to external callers that this Overlay should not be used for providingoption menu items.
      void setWidth(int width) Sets the width of the mini-map in pixels
      int getWidth() Gets the width of the mini-map in pixels
      void setHeight(int height) Sets the height of the mini-map in pixels
      int getHeight() Gets the height of the mini-map in pixels
      void setPadding(int padding) Sets the number of pixels from the lower-right corner to offset the mini-map
      int getPadding() 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 context
        pTileRequestCompleteHandler - a handler for the tile request complete notifications
        pTileProvider - a tile provider
      • MinimapOverlay

        MinimapOverlay(Context pContext, Handler pTileRequestCompleteHandler, MapTileProviderBase pTileProvider)
        Creates a MinimapOverlay with the supplied tile provider.
        Parameters:
        pContext - a context
        pTileRequestCompleteHandler - a handler for the tile request complete notifications
        pTileProvider - a tile provider
      • MinimapOverlay

        MinimapOverlay(Context pContext, Handler pTileRequestCompleteHandler)
        Creates a MinimapOverlay that uses its own MapTileProviderBasic.
        Parameters:
        pContext - a context
        pTileRequestCompleteHandler - a handler for tile request complete notifications
    • Method Detail

      • 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