1
votes

Im using style switch as it is in this example https://www.mapbox.com/mapbox-gl-js/example/setstyle/

This code works fine, but when I switch the style all of layers above basic mapbox style (build in mapbox studio) loaded with map.addLayer(); are gone.

Is it possible to switch style only "below" thoose additional layers ? Should I trigger some way all of addLayers action ?

Mike

1
Mods, this is a duplicate of stackoverflow.com/questions/49106792/… but i can't flag it since the answer is neither accepted nor upvotedAndrewHarvey

1 Answers

0
votes

Persistent layers after style change in Mapbox gl js

Check out https://github.com/mapbox/mapbox-gl-js/issues/4006 for a few ideas of how this could be made easier along with some workarounds