Mapbox gl js中样式更改后的持久层 [英] Persistent layers after style change in Mapbox gl js

查看:161
本文介绍了Mapbox gl js中样式更改后的持久层的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以将地图样式从街景视图更改为保留所有手动绘制的图层(geojson形状)的卫星?

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.

mapbox是否支持任何多样式地图实例? 还是可以将整个样式作为背景呈现,或者甚至可以将Streetview作为我的主要样式的图层来实现?

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?

推荐答案

查看 https://github.com/mapbox/mapbox-gl-js/issues/4006 ,了解一些有关如何使其更容易实现的想法,以及一些解决方法.

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.

这篇关于Mapbox gl js中样式更改后的持久层的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆