Mapbox - 什么决定了显示国家/地区标签的缩放级别?
Mapbox - what determines at which zoom level a country label is displayed?
这个问题是关于 Mapbox Studio 的。我的用例显示了不同国家之间的税收协定地图,其中一些非常小的国家由于是避税天堂而很重要,例如毛里求斯。毛里求斯岛的标签仅在地图缩放级别 2 或更高级别显示,而将此标签显示在与其他较大国家/地区相同的突出位置会很有用。标签是烘焙到 Mapbox 瓦片中还是有控制它们何时出现的方法?
我发现您可以进一步过滤显示哪些国家/地区,但不能控制显示它们的缩放级别的初始设置。
大多数时候,当想要更改特定标签的样式时,最好的方法是在该特定缩放级别上遵循 customizing label text for a single label. However, as you mentioned, the island of Mauritius is only displayed at map zoom level 2. We can determine that this is a limitation of how the source data is being included in the Mapbox Streets tileset by following the steps outlined below. Sometimes, data does not appear in a map style because of the way it is styled (i.e. how the properties are specified for the relevant layer), whereas other times it does not appear because it is simply not included in the underlying tileset 上的本指南。 Tilesets 有条件地包含不同缩放级别的数据以提高性能。
- 导航到样式的相关图层(在本例中为
country-label
符号图层)。
- 切换到
Select data
选项卡。此视图允许您查看哪些标签在特定缩放级别可见。
- 探索不同的缩放级别以查看包含在该缩放级别的绿色功能。在这里,我们看到
Mauritius
不在 z1.99
处,而是在 z2
. 处
幸运的是,Mapbox Streets 背后的大部分数据都来自 OpenStreetMap,您可以使用多种不同的方法下载您需要的数据,然后将其包含在您的地图样式中:
- 使用 Overpass Turbo 下载您想使用的数据。
- 从这里开始,您有两个选项来平铺数据 - 您可以使用 Mapbox Tilesets API or the Mapbox-created open source tool Tippecanoe. You can learn how to adjust the zoom extent of your data using either tool in this guide。
- Upload the tileset 在上一步创建到您的 Mapbox 帐户。
- Add a new layer 在你的样式中引用了这个 tileset。然后您可以指定该图层以低于
z2
. 的缩放级别显示
如果您只想添加几个国家/地区标签,手动创建包含标签和坐标的 GeoJSON 文件,然后使用 Tilesets API 对这些数据进行拼贴可能会更容易,而不是使用 Overpass Turbo 下载数据。
这个问题是关于 Mapbox Studio 的。我的用例显示了不同国家之间的税收协定地图,其中一些非常小的国家由于是避税天堂而很重要,例如毛里求斯。毛里求斯岛的标签仅在地图缩放级别 2 或更高级别显示,而将此标签显示在与其他较大国家/地区相同的突出位置会很有用。标签是烘焙到 Mapbox 瓦片中还是有控制它们何时出现的方法?
我发现您可以进一步过滤显示哪些国家/地区,但不能控制显示它们的缩放级别的初始设置。
大多数时候,当想要更改特定标签的样式时,最好的方法是在该特定缩放级别上遵循 customizing label text for a single label. However, as you mentioned, the island of Mauritius is only displayed at map zoom level 2. We can determine that this is a limitation of how the source data is being included in the Mapbox Streets tileset by following the steps outlined below. Sometimes, data does not appear in a map style because of the way it is styled (i.e. how the properties are specified for the relevant layer), whereas other times it does not appear because it is simply not included in the underlying tileset 上的本指南。 Tilesets 有条件地包含不同缩放级别的数据以提高性能。
- 导航到样式的相关图层(在本例中为
country-label
符号图层)。 - 切换到
Select data
选项卡。此视图允许您查看哪些标签在特定缩放级别可见。 - 探索不同的缩放级别以查看包含在该缩放级别的绿色功能。在这里,我们看到
Mauritius
不在z1.99
处,而是在z2
. 处
幸运的是,Mapbox Streets 背后的大部分数据都来自 OpenStreetMap,您可以使用多种不同的方法下载您需要的数据,然后将其包含在您的地图样式中:
- 使用 Overpass Turbo 下载您想使用的数据。
- 从这里开始,您有两个选项来平铺数据 - 您可以使用 Mapbox Tilesets API or the Mapbox-created open source tool Tippecanoe. You can learn how to adjust the zoom extent of your data using either tool in this guide。
- Upload the tileset 在上一步创建到您的 Mapbox 帐户。
- Add a new layer 在你的样式中引用了这个 tileset。然后您可以指定该图层以低于
z2
. 的缩放级别显示
如果您只想添加几个国家/地区标签,手动创建包含标签和坐标的 GeoJSON 文件,然后使用 Tilesets API 对这些数据进行拼贴可能会更容易,而不是使用 Overpass Turbo 下载数据。