Skip to content Skip to sidebar Skip to footer

Changing Osmdroid's Mylocationoverlay Marker

I want to change the marker in the MyLocationOverlay. What I've tried so far is subclassing OSMDroid's MyLocationOverlay and overriding the default marker, using code provided in t

Solution 1:

You have a few options here. First, let me suggest you use MyLocationNewOverlay in osmdroid. The original MyLocationOverlay has been deprecated. You then can

  1. Create your own ResourceProxy that provides your custom bitmap.person resource.
  2. Create a subclass and modify the mPersonBitmap and optionally the mPersonHotspot to make sure your custom image is aligned properly.
  3. The method signature you are looking to override as per the linked answer is:

    protectedvoiddrawMyLocation(final ISafeCanvas canvas, final MapView mapView, final Location lastFix)

Post a Comment for "Changing Osmdroid's Mylocationoverlay Marker"