Persistent layers after style change in Mapbox gl js

你。 提交于 2019-12-11 17:56:01

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!