Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Layers: bind added layer in set #1119

Merged
merged 1 commit into from
Apr 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions vtm/src/org/oscim/map/Layers.java
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,30 @@ public synchronized Layer set(int index, Layer layer) {
return layer;
}

// bind added layer
if (layer instanceof UpdateListener)
mMap.events.bind((UpdateListener) layer);
if (layer instanceof InputListener)
mMap.input.bind((InputListener) layer);
// add zoom limit to tile manager
if (layer instanceof ZoomLimiter.IZoomLimiter)
((ZoomLimiter.IZoomLimiter) layer).addZoomLimit();

// bind added group layer
if (layer instanceof GroupLayer) {
GroupLayer groupLayer = (GroupLayer) layer;
for (Layer gl : groupLayer.layers) {
if (gl instanceof UpdateListener)
mMap.events.bind((UpdateListener) gl);
if (gl instanceof InputListener)
mMap.input.bind((InputListener) gl);
if (gl instanceof ZoomLimiter.IZoomLimiter)
((ZoomLimiter.IZoomLimiter) gl).addZoomLimit();
}
}

layer.setEnableHandler(mEnableHandler);

mDirtyLayers = true;
Layer remove = mLayerList.set(index, layer);

Expand Down
Loading