Package 

Class MyLocationNewOverlay

    • Constructor Detail

      • MyLocationNewOverlay

        MyLocationNewOverlay(MapView mapView)
    • Method Detail

      • onResume

         void onResume()

        Triggered on application lifecycle changes, assuming the mapview is triggered appropriatelyrelated issue https://github.com/osmdroid/osmdroid/issues/823https://github.com/osmdroid/osmdroid/issues/806

      • onPause

         void onPause()

        Triggered on application lifecycle changes, assuming the mapview is triggered appropriatelyrelated issue https://github.com/osmdroid/osmdroid/issues/823https://github.com/osmdroid/osmdroid/issues/806

      • onDetach

         void onDetach(MapView mapView)

        Override to perform clean up of resources before shutdown. By default does nothing.

      • setDrawAccuracyEnabled

         void setDrawAccuracyEnabled(boolean drawAccuracyEnabled)

        If enabled, an accuracy circle will be drawn around your current position.

        Parameters:
        drawAccuracyEnabled - whether the accuracy circle will be enabled
      • isDrawAccuracyEnabled

         boolean isDrawAccuracyEnabled()

        If enabled, an accuracy circle will be drawn around your current position.

      • onSnapToItem

         boolean onSnapToItem(int x, int y, Point snapPoint, IMapView mapView)

        Checks to see if the given x and y are close enough to an item resulting in snapping thecurrent action (e.g. zoom) to the item.

        Parameters:
        x - The x in screen coordinates.
        y - The y in screen coordinates.
        snapPoint - To be filled with the the interesting point (in screen coordinates) that isclosest to the given x and y.
        mapView - The MapView that is requesting the snap.
      • onTouchEvent

         boolean onTouchEvent(MotionEvent event, MapView mapView)

        You can prevent all(!) other Touch-related events from happening!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.

      • getMyLocation

         GeoPoint getMyLocation()

        Return a GeoPoint of the last known location, or null if not known.

      • enableFollowLocation

         void enableFollowLocation()

        Enables "follow" functionality. The map will center on your current location andautomatically scroll as you move. Scrolling the map in the UI will disable.

      • isFollowLocationEnabled

         boolean isFollowLocationEnabled()

        If enabled, the map will center on your current location and automatically scroll as youmove. Scrolling the map in the UI will disable.

      • enableMyLocation

         boolean enableMyLocation()

        Enable receiving location updates from the provided IMyLocationProvider and show yourlocation on the maps. You will likely want to call enableMyLocation() from your Activity'sActivity.onResume() method, to enable the features of this overlay. Remember to call thecorresponding disableMyLocation() in your Activity's Activity.onPause() method to turn offupdates when in the background.

      • isMyLocationEnabled

         boolean isMyLocationEnabled()

        If enabled, the map is receiving location updates and drawing your location on the map.

      • runOnFirstFix

         boolean runOnFirstFix(Runnable runnable)

        Queues a runnable to be executed as soon as we have a location fix. If we already have a fix,we'll execute the runnable immediately and return true. If not, we'll hang on to the runnableand return false; as soon as we get a location fix, we'll run it in in a new thread.

      • setPersonIcon

         void setPersonIcon(Bitmap icon)

        enables you to change the my location 'person' icon at runtime. note that thehotspot is not updated with this method. see setPersonAnchor

      • setPersonAnchor

         void setPersonAnchor(float pHorizontal, float pVertical)

        Anchors for the person iconExpected values between 0 and 1, 0 being top/left, .5 center and 1 bottom/right

      • setDirectionAnchor

         void setDirectionAnchor(float pHorizontal, float pVertical)

        Anchors for the direction iconExpected values between 0 and 1, 0 being top/left, .5 center and 1 bottom/right