问题
Is it possible to change map style from Streetview to satellite retaining all manually drawn layers (geojson shapes)?
e.g. Let's say we have a circle on Streetview map and want to show the same circle in street view mode. After we change map style to satellite we have to add the circle again. Is there any possibility to avoid that?
I want to find the possibility do not process something that was processed already again, to exclude listening for style changes and adding layers again.
Is any multi styles map instances supported by mapbox? Or the possibility to render the whole style as a background or might be even having Streetview as a layer in my main style to achieve that?
回答1:
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.
来源:https://stackoverflow.com/questions/49106792/persistent-layers-after-style-change-in-mapbox-gl-js