是否有可能通过ISO 3166-1 alpha-3国家代码过滤边界分界线?如果是,那怎么做?我在文件里查过了,但什么也没找到。这就是我目前如何过滤两个字符的国家代码iso_3166_1,我尝试把它从'iso_3166_1‘改为'iso_3166_1_alpha_3',这是引用不同的东西时发现的,但是它不起作用。
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');
});
});发布于 2020-07-28 21:23:53
Mapbox边界v3 tileset在实际的瓷砖中只有几个特性,对于多边形,它们是:
在这里查看完整的参考文档:https://docs.mapbox.com/vector-tiles/reference/mapbox-boundaries-v3/#polygon-tileset-reference
其余的数据存储在补充查找表中,这些表是在您购买tileset时发送的。您可以在这里看到所有可用的属性:https://docs.mapbox.com/help/tutorials/get-started-mapbox-boundaries/#feature-lookup-tables
您需要执行一个数据连接,以便在您的javascript中访问这些查找表中的数据。有一个教程在这里引导您完成这个过程:https://docs.mapbox.com/help/tutorials/data-joins-with-mapbox-boundaries/
https://stackoverflow.com/questions/60592557
复制相似问题