首页 > 解决方案 > MapBox GL JS (WMS Tile) - 添加来自不同域的单个图层

问题描述

基本上我希望我的图层的一些图块使用域 A,一些图块将使用域 B,而一些图块将使用域 C。

标签: mapboxmapbox-gl-jswms

解决方案


您可以在源中指定多个图块端点https://docs.mapbox.com/mapbox-gl-js/style-spec/sources/

"mapbox-streets": {
    "type": "vector",
    "tiles": [
        "http://a.example.com/tiles/{z}/{x}/{y}.pbf",
        "http://b.example.com/tiles/{z}/{x}/{y}.pbf"
    ],
    "maxzoom": 14
}

推荐阅读