Mapbox 按ISO 3166-1 alpha-3国家代码过滤边界瓷砖集
是否可以按ISO 3166-1 alpha-3国家代码过滤边界瓷砖集?如果是的话,怎么办?我在文档中搜索了一下,但什么也没找到。这就是我目前如何通过2个字符过滤tileset国家代码iso_3166_1。我试着将它从“iso_3166_1”改为“iso_3166_1_alpha_3”,这是在引用其他内容时发现的,但它不起作用Mapbox 按ISO 3166-1 alpha-3国家代码过滤边界瓷砖集,mapbox,mapbox-gl,Mapbox,Mapbox Gl,是否可以按ISO 3166-1 alpha-3国家代码过滤边界瓷砖集?如果是的话,怎么办?我在文档中搜索了一下,但什么也没找到。这就是我目前如何通过2个字符过滤tileset国家代码iso_3166_1。我试着将它从“iso_3166_1”改为“iso_3166_1_alpha_3”,这是在引用其他内容时发现的,但它不起作用 mapBox.on('load', () => { mapBox.addSource('admin-1', { type: 'vector',
mapBox.on('load', () => {
mapBox.addSource('admin-1', {
type: 'vector',
url: 'mapbox://mapbox.boundaries-adm1-v3'
});
var countriesToDisplay: Array<string> = ['US', 'NZ']
countriesToDisplay.forEach((countryCode: string) => {
mapBox.addLayer({
id: 'admin-1-fill-' + countryCode,
type: 'fill',
source: 'admin-1',
'source-layer': 'boundaries_admin_1',
filter: ['any', ['all', ['==', ['get', 'iso_3166_1'], countryCode]]],
paint: { 'fill-color': '#044e9c' }
}, 'waterway-label');
});
});
mapBox.on('load',()=>{
mapBox.addSource('admin-1'{
键入:“向量”,
网址:'mapbox://mapbox.boundaries-adm1-v3'
});
变量countriesToDisplay:Array=['US','NZ']
countriesToDisplay.forEach((countryCode:string)=>{
mapBox.addLayer({
id:'admin-1-fill-'+国家代码,
类型:“填充”,
资料来源:“admin-1”,
“源层”:“边界管理1”,
筛选器:['any',['all',['=',['get','iso_3166_1'],countryCode]],
绘画:{“填充颜色”:“044e9c”}
}“水道标签”);
});
});
贴图盒边界v3平铺集在实际平铺中只有几个功能,对于多边形,它们是:
- 身份证
- iso_3166_1
- 世界观