-
Notifications
You must be signed in to change notification settings - Fork 121
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
Refreshing symbols #959
Comments
There is an icon image cache, but a new one is created for each call to |
That would require some work, as there is a lot of code divided in multiple files and functions. Condensed down, this is actually what's been done on a new map instance: const layerGroup = new LayerGroup()
const style = isDarkMode ? nightModeStyle : normalStyle
olms.apply(layerGroup, style)
const layers = olMap.getLayers()
layers.insertAt(0, layerGroup) EDIT: Forgot to mention that I'm using
|
Update: Since When renaming So yep, seems like there is indeed cache mechanisms at play. |
So what you can try to do is give style2 a different style1: {
"version": 8,
"id": "style1", style2: {
"version": 8,
"id": "style2", |
The MapBox style specification does not mention We're using a 3rd party supplier for the service, and the style doc does not have an |
If there is no id present, you should be fine - ol-mapbox-style will auto-generate one. You're right, the I think in order to reproduce this, it will be best if you can provide a simple example that shows the problem. Because to this point, I have not been able to reproduce the problem. |
This particular service is hosted on an ESRI server, for reference. I'll see if I get the time create an example to reproduce this. Until further, I worked around this as explained above:
That's a low effort solution that seems to work fine for now, producing the same result as you're proposing. I loop the layers anyway when processing the |
I got a case where the style document has 3 different sources, hence multiple layers are created.
The application has two different pages, using the same tiles but with different styles. When creating a new Map(), then using apply() for the vector tiles, the new instance of the map renders tiles with the same style as the previous instance. That is, until I zoom to somewhere else outside the "home-extent", when it starts to display correct colors (and of course, when I refresh the entire page)
Seems like the symbols are being cached somewhere, but can't figure a way to clear this.
I'm using the most recent versions of ol-mapbox-style and OpenLayers.
The text was updated successfully, but these errors were encountered: