maps
maps copied to clipboard
layoutLayer ceases to be called when MapView is wrapped by another container
A layer (PoiLayer) added to MapView gets synchronized with the underlying map (translation and zoom).
However, when the MapView is child of another container, at some point the layoutLayer
call ceases and the PoiLayer is not synced for a while.
Possible fix in MapView
:
protected void markDirty() {
dirty = true;
Parent p = this;
while (p != null) {
p.setNeedsLayout(true);
p = p.getParent();
}
}
however Parent::setNeedsLayout
is protected.
This works in any case:
protected void markDirty() {
dirty = true;
this.requestLayout();
}
I've run into this with a MapView not updating BaseMap whilst panning inside a container. I really don't understand what is going on, but something to do with layoutChildren not being called until a call to MapView.getLayoutBounds.