Comments (3)
Hi!
You can update style with mapbox-gl map instance : which is returned by layer.getGlMap()
.
from maptalks.mapboxgl.
Thanks a lot, that worked:
map.getBaseLayer().getGlMap().setStyle(styleUrl)
from maptalks.mapboxgl.
Thanks a lot, that worked:
map.getBaseLayer().getGlMap().setStyle(styleUrl)
Hi guys,
I think I have the same problem with @jakob-fuchs, but what I intended to do was to change from
var map = new maptalks.Map("map",{
//limit max pitch to 60 as mapbox-gl-js required
center: [-74.0066, 40.7135],
zoom: 15.5,
pitch: 45,
bearing: -17.6,
container: 'map',
baseLayer: new maptalks.TileLayer('base', {
urlTemplate: 'http://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png',
subdomains: ['a','b','c','d'],
attribution: '© <a href="http://osm.org">OpenStreetMap</a> contributors, © <a href="https://carto.com/">CARTO</a>'
})
});
to this one.
map = new maptalks.Map("map",{
center: [-74.0066, 40.7135],
zoom: 15.5,
pitch: 45,
bearing: -17.6,
container: 'map',
baseLayer: mapboxglLayer
});
because I needed mapboxBase to render some style from mapbox.
The way that I'm using right now is map.remove() and new map again. But it seems to mess up with some part of the code, I'n not sure if you guys have any suggestion?
"map.getBaseLayer().getGlMap().setStyle(styleUrl)" doesn't work for me.
Thank you!
from maptalks.mapboxgl.
Related Issues (20)
- 支持在mapboxgl上继续集成mapboxgl的插件吗?例如deck.gl? HOT 1
- epsg:4326
- 使用import导入时报错 HOT 2
- Cannot click on mapbox control HOT 1
- 加载了百度或高德在线底图,然后再用该插件加载一个自定义的矢量切片服务,图层永远在底图下面被挡住 HOT 1
- After the geojson data is converted to geometry, how do I add click events to the geometry set? HOT 3
- 当使用MapboxglLayer读取mapbox的style作为地图时,在倾斜地图后,再旋转地图,已经绘制的线要素会发生无规律偏移
- 拖动过程中mapbox地图会滞后 HOT 8
- npm install maptalks.mapboxgl. 出错! HOT 1
- 现有mapbox地图已经创建(存在),maptalks如何加载现有的mapboxgl,而不是重新创建? HOT 4
- Error when using custom style HOT 1
- mapboxgl原生的地图事件被屏蔽了,该怎么获取到了
- 地图实例设置cssFilter不起作用
- vt矢量图层可以支持局部平面坐标系不
- 如何使用这个插件叠加pbf切片
- shaking when zooming
- there is a problem on: http://maptalks.org/maptalks.mapboxgl/demo/ HOT 1
- mapbox 's event HOT 1
- ES6 Import HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from maptalks.mapboxgl.