[android] - correct anchoring when Icon is updated (#8519)
This commit is contained in:
@@ -389,6 +389,15 @@ public class MarkerView extends Marker {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Invalidates the MarkerView resulting in remeasuring the View.
|
||||
*/
|
||||
void invalidate() {
|
||||
width = height = 0;
|
||||
offsetX = offsetY = MapboxConstants.UNMEASURED;
|
||||
markerViewManager.invalidateViewMarkersInVisibleRegion();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the String representation of a MarkerView.
|
||||
*
|
||||
|
||||
@@ -233,6 +233,7 @@ public class MarkerViewManager implements MapView.OnMapChangedListener {
|
||||
View convertView = markerViewMap.get(markerView);
|
||||
if (convertView != null && convertView instanceof ImageView) {
|
||||
((ImageView) convertView).setImageBitmap(markerView.getIcon().getBitmap());
|
||||
markerView.invalidate();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user