[android] - correct anchoring when Icon is updated (#8519)

This commit is contained in:
Tobrun
2017-03-24 18:41:20 +01:00
committed by GitHub
parent 83cef9eb68
commit c7722b54a8
2 changed files with 10 additions and 0 deletions

View File

@@ -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.
*

View File

@@ -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();
}
}