# VectorTileSource
扩展事件
包含矢量瓦片格式矢量瓦片的源 ``. (见样式规范 有关选项的详细文档。)
# Parameters
idstringoptions任何dispatcher调度员eventedParent事件发生
# Examples
map.addSource('some id', {
type: 'vector',
url: 'your url'
});
1
2
3
4
2
3
4
map.addSource('some id', {
type: 'vector',
tiles: ['https://xxx/{z}/{x}/{y}.mvt'],
minzoom: 6,
maxzoom: 14
});
1
2
3
4
5
6
2
3
4
5
6
map.getSource('some id').setUrl("your url");
1
map.getSource('some id').setTiles(['https://xxx/{z}/{x}/{y}.mvt']);
1
# setTiles
设置源tiles属性并重新渲染地图。
# Parameters
tiles**Array<string>**一个或多个图块源 URL 的数组,如 TileJSON 规范中所示。
返回**[VectorTileSource][260]**这个
# setUrl
设置源url属性并重新渲染地图。
# Parameters
url**string**TileJSON 资源的 URL。支持的协议是http:,https:。
返回**[VectorTileSource][260]**这个