[android] Dynamic update of InfowWindow with InfoWindowAdapter example
Fixes #5353
This commit is contained in:
committed by
Antonio Zugaldia
parent
cc1e2610c7
commit
2033d756c2
@@ -259,11 +259,20 @@ public class InfoWindow {
|
||||
View view = mView.get();
|
||||
if (mapboxMap != null && marker != null && view != null) {
|
||||
mCoordinates = mapboxMap.getProjection().toScreenLocation(marker.getPosition());
|
||||
view.setX(mCoordinates.x + mViewWidthOffset - mMarkerWidthOffset);
|
||||
|
||||
if (view instanceof InfoWindowView) {
|
||||
view.setX(mCoordinates.x + mViewWidthOffset - mMarkerWidthOffset);
|
||||
} else {
|
||||
view.setX(mCoordinates.x - (view.getMeasuredWidth() / 2) - mMarkerWidthOffset);
|
||||
}
|
||||
view.setY(mCoordinates.y + mMarkerHeightOffset);
|
||||
}
|
||||
}
|
||||
|
||||
public View getView() {
|
||||
return mView != null ? mView.get() : null;
|
||||
}
|
||||
|
||||
boolean isVisible() {
|
||||
return mIsVisible;
|
||||
}
|
||||
|
||||
@@ -117,6 +117,11 @@ public class Marker extends Annotation {
|
||||
refreshInfoWindowContent();
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public InfoWindow getInfoWindow() {
|
||||
return infoWindow;
|
||||
}
|
||||
|
||||
/**
|
||||
* Update only for default Marker's InfoWindow content for Title and Snippet
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user