maps icon indicating copy to clipboard operation
maps copied to clipboard

layoutLayer ceases to be called when MapView is wrapped by another container

Open jperedadnr opened this issue 4 years ago • 2 comments

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.

jperedadnr avatar Jul 24 '20 11:07 jperedadnr

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

jperedadnr avatar Jul 24 '20 11:07 jperedadnr

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.

ctipper avatar Jun 06 '22 10:06 ctipper