File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ public class MapViewCoordinator: NSObject {
1111 // every update cycle so we can avoid unnecessary updates
1212 private var snapshotUserLayers : [ StyleLayerDefinition ] = [ ]
1313 private var snapshotCamera : MapViewCamera ?
14+ private var snapshotStyleSource : MapStyleSource ?
1415
1516 // Indicates whether we are currently in a push-down camera update cycle.
1617 // This is necessary in order to ensure we don't keep trying to reset a state value which we were already processing
@@ -105,12 +106,16 @@ public class MapViewCoordinator: NSObject {
105106 // MARK: - Coordinator API - Styles + Layers
106107
107108 @MainActor func updateStyleSource( _ source: MapStyleSource , mapView: MLNMapView ) {
108- switch ( source, parent . styleSource ) {
109+ switch ( source, snapshotStyleSource ) {
109110 case let ( . url( newURL) , . url( oldURL) ) :
110111 if newURL != oldURL {
111112 mapView. styleURL = newURL
112113 }
114+ case let ( . url( newURL) , . none) :
115+ mapView. styleURL = newURL
113116 }
117+
118+ snapshotStyleSource = source
114119 }
115120
116121 @MainActor func updateLayers( mapView: MLNMapView ) {
You can’t perform that action at this time.
0 commit comments