Replies: 3 comments 4 replies
-
Any suggestions? |
Beta Was this translation helpful? Give feedback.
-
If you need to change the map style, you should generally perform the following operations:
You can easily do so by maintaining a |
Beta Was this translation helpful? Give feedback.
-
Thanks for your explanations @Pessimistress. |
Beta Was this translation helpful? Give feedback.
-
I'd like to display a geojson layer on top of Mapbox vector tiles, but the geojson should not hide any of the map's labels. I found the
Layer
'sbeforeId
prop and set it to the first symbol layer of the Mapbox style. This works, but I also want to include a toggle that allows changing the Mapbox style. Unfortunately, the way I implemented this the style toggling results in this console error:The map style changes as expected, but the
beforeId
of the previous layer is still used and when it is not available in the new style this error occurs.I took your geojson example and adjusted it to my use-case here: easbar@47f9edd
My requirements seem pretty common:
I wonder what the recommended way to do this is and if there is anything I can do to prevent this console error.
Beta Was this translation helpful? Give feedback.
All reactions