I have several stops in route and I wanna display them with customized icons. Everything works like a charm when using default osmdroid icons. But when I change them to image from drawable, markers are displayed above the route (see the image).
Marker marker = new Marker(mapView);
marker.setPosition(new GeoPoint(info.getLat(), info.getLon()));
marker.setAnchor(ANCHOR_CENTER, ANCHOR_BOTTOM);
marker.setTitle(info.getName());
Drawable d = ResourcesCompat.getDrawable(getResources(), R.drawable.bus, null);
Bitmap bitmap = ((BitmapDrawable) d).getBitmap();
Drawable dr = new BitmapDrawable(getResources(), Bitmap.createScaledBitmap(bitmap, (int) (48.0f * getResources().getDisplayMetrics().density), (int) (48.0f * getResources().getDisplayMetrics().density), true));
marker.setIcon(dr);
mapView.getOverlays().add(marker);
mapView.invalidate();
Im using osmbonuspack:6.6.0 and osmdroid-android:6.1.0 and Android 9 (API 28).
I already tried to set android:hardwareAccelerated="false" as it said in OSMDroid - Default marker moving when zooming out on Android API 28 or setAnchor(ANCHOR_CENTER,ANCHOR_CENTER) but it wasnt working.
Is there any other solution?

The issue with this approach seems to be related to custom icon resolution, it parse the real resolution but it downscales the displayed image. As a fix / workaround you can move your custom png marker out of
drawablefolder intomipmap-xxxhdpifor example. And also don't forget to set the anchor, like:customMarker.setAnchor(Marker.ANCHOR_CENTER, Marker.ANCHOR_BOTTOM);L.E. Do not forget to use a high resolution marker(I have tested with png image)