-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Removing source processed by the layer #12526
Comments
Whoops, obviously we first need to remove a |
My idea was to patch this up as part of #10947 |
MGLStyle doesn’t explicitly document the fact that the developer shouldn’t remove sources or images that are currently being used by layers. If they try to do that, mbgl logs a warning to the console and fails silently (or gracefully, depending on your point of view).
Since we subsequently nil out the source’s map view backpointer and pending source pointer, we’re unable to prevent the developer from adding the same source to a different map view’s style: mapbox-gl-native/platform/darwin/src/MGLSource.mm Lines 62 to 63 in 60cbedc
mapbox-gl-native/platform/darwin/src/MGLSource.mm Lines 51 to 53 in 60cbedc
|
Can we move forward in 10947 as @tobrun suggests? |
android equivalent of #9692 |
When removing a
Source
that's being currently processed by aLayer
we are failing silently and printing a log.We should improve the experience during this unusual condition by maybe printing a higher level log, and on the Android side updating docs and returning
null
instead of theSource
object in theMapboxMap#removeSource
when it fails.Example that will fail:
How's @mapbox/maps-ios handling this scenario?
The text was updated successfully, but these errors were encountered: