Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Commit

Permalink
[android] - correct anchoring when Icon is updated
Browse files Browse the repository at this point in the history
  • Loading branch information
tobrun committed Mar 24, 2017
1 parent 83cef9e commit afa066a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,15 @@ public void setMapboxMap(MapboxMap mapboxMap) {
}
}

/**
* 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.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ public void updateIcon(@NonNull MarkerView markerView) {
View convertView = markerViewMap.get(markerView);
if (convertView != null && convertView instanceof ImageView) {
((ImageView) convertView).setImageBitmap(markerView.getIcon().getBitmap());
markerView.invalidate();
}
}

Expand Down

0 comments on commit afa066a

Please sign in to comment.