Skip to content

Change style with lines/symblos #485

Answered by Josh-Dovey
ForWarZz asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @ForWarZz,

Are you using geoJSON?

If so, I believe that when adding geoJSON you are essentially adding to the existing style. A typical style has all sources (your data) at the top and your layers (How your source data should render on the map) array beneath.

When switching style urls I presume your layers and sources get removed as they are not in the style JSON that you have just fetched from your new url.

To resolve, before switching your style url, you would need to keep a record of all your added sources and layers and then on style switch, add them all back (as you mentioned "re add all of my lines").

So to answer your question, yes. I would say this is normal behaviour.

Hope thi…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@ForWarZz
Comment options

Answer selected by josxha
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants