Repository navigation
Conversation
… correct Map event fires when a stale style gets refreshed from the server.
|
I'm pretty sure we don't want to change the semantics of What's the underlying need you're trying to satisfy here? |
|
The problem here is that setStyle doesn't get called when a resource expires and is refetched. This means that the map reloads, but the MapChangeDidFinishLoadingMap event never fires, which is wrong. If someone is relying on that event to say, add a custom layer to the style, then when the style expires that custom layer will disappear forever, until the style is explicitly changed. |
|
Perhaps a cleaner solution is to not keep the same request around to handle resource expiration, and explicitly call |
|
@tmpsantos @brunoabinader thoughts? |
|
I suggest we add a new enum e.g. |
I like the idea. |
|
I don't really understand what the difference is. If you have something that you want to happen whenever the map finishes loading, why wouldn't you want to do it when the map reloads? Can anyone actually come up with an example where semantics are being violated, because i'm struggling to. Put another way, if I make a call to setStyle(), it will trigger a MapChangeDidFinishLoading. If the map refreshes, the style is still changed in the same mechanism; setStyleJSON is still called. The only difference is that the callback is not triggered. This seems like a bug to me, not a feature, and it seems semantically incorrect. If the style needs to reload, I think it's a safe assumption that the post-load hook needs to fire again. |
… correct Map event fires when a stale style gets refreshed from the server.