Hi,
I am experiencing a very strange issue with
tomtomMap.getMarkerSettings().updateMarkerIcon(marker, icon) method.
First let me explain how I used the method in my activity. I tried multiple scenarios.
case 1) icon is obtained from resource
Icon icon = Icon.Factory.fromResources(context, R.drawable.marker1);
tomtomMap.getMarkerSettings().updateMarkerIcon(marker, icon);
I did not have any problem in this case.
case 2) icon is obtained from drawable
Drawable drawable = getResources().getDrawable(R.drawable.marker1);
Icon icon = Icon.Factory.fromDrawable("marker1", drawable);
tomtomMap.getMarkerSettings().updateMarkerIcon(marker, icon);
I had a strange issue this one. The icon was updated fine when the above lines were called once, but when I called the above lines twice consecutively, the icon was NOT updated during the second run.
case 3) icon is obtained from LayerDrawable
Drawable drawable1 = getResources().getDrawable(R.drawable.marker_layer1);
Drawable drawable2 = getResources().getDrawable(R.drawable.marker_layer2);
Drawable[] layers = new Drawable[2];
layers[0] = drawable1;
layers[1] = drawable2;
Icon icon = Icon.Factory.fromLayerDrawable("marker1", layers);
tomtomMap.getMarkerSettings().updateMarkerIcon(marker, icon);
I got the same result as in case 2. The icon was updated during first run, but the icon was NOT updated during the second run.
In my app, I am updating the marker icon with LayerDrawable multiple times, so I need to fix this issue. I am guessing the issue is related to the passing context?
Could you take a look at this issue, and let me know how I can fix this?