[android] do not clear native layers and sources when style is reloading
This prevents unnecessary layers blink when the same components are re-added after the style reload.
This commit is contained in:
committed by
Łukasz Paczos
parent
6998e9a8ed
commit
6a4e431dbe
@@ -1182,7 +1182,6 @@ public final class LocationComponent {
|
||||
}
|
||||
|
||||
isLayerReady = false;
|
||||
locationLayerController.hide();
|
||||
staleStateManager.onStop();
|
||||
if (compassEngine != null) {
|
||||
updateCompassListenerState(false);
|
||||
@@ -1289,6 +1288,7 @@ public final class LocationComponent {
|
||||
|
||||
private void disableLocationComponent() {
|
||||
isEnabled = false;
|
||||
locationLayerController.hide();
|
||||
onLocationLayerStop();
|
||||
}
|
||||
|
||||
|
||||
@@ -523,14 +523,12 @@ public class Style {
|
||||
for (Layer layer : layers.values()) {
|
||||
if (layer != null) {
|
||||
layer.setDetached();
|
||||
nativeMap.removeLayer(layer);
|
||||
}
|
||||
}
|
||||
|
||||
for (Source source : sources.values()) {
|
||||
if (source != null) {
|
||||
source.setDetached();
|
||||
nativeMap.removeSource(source);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user