I am trying to change the overlay icon for MyLocationNewOverlay using the setPersonIcon (bitmap) method but the marker still appears with the default icon.
Sharing the code I am using from OSM - Show current location with custom icon below:
mLocationOverlay.enableMyLocation();
Drawable currentDraw = ResourcesCompat.getDrawable(getResources(), R.drawable.joker, null);
Bitmap currentIcon = null;
if (currentDraw != null) {
currentIcon = ((BitmapDrawable) currentDraw).getBitmap();
}
mLocationOverlay.setPersonIcon(currentIcon);
mLocationOverlay.enableFollowLocation();
map.getOverlays().add(mLocationOverlay);
I am running this on an AVD on mac os 10.15 public beta
Based on a comment on an open issue on osmdroid github page i also tried Genymotion, but the behaviour on that was even more weird with none of the overlays except scaleoverlay working on genymotion emulator, nether setting zoom level in code.
I haven’t yet tried the code on an actual android device
UPDATE: When trialing the app while driving I realized that the customer PersonIcon appeared whenever I was stationary and switched to the white arrow when moving. This lead me back to the documentation and realized that had to also update the person icon while moving using the setDirectionArrow method.