mapboxGL前端如何将发布的瓦片服务背景色设置为透明的

0 投票

以下是代码:

let map = new mapboxgl.Map({

        container: "xianzhuangmap",

        style: {

          version: 8,

          sources: {

            "raster-tiles": {

              type: "raster",

              tiles: [

                "https://t-iserver.rainet.com.cn/iserver/services/map-ugcv5-henan03/rest/maps/henan03" +

                  "/zxyTileImage.png?z={z}&x={x}&y={y}",

              ],

              tileSize: 256,

            },

          },

          layers: [

            {

              id: "simple-tiles",

              type: "raster",

              source: "raster-tiles",

              minzoom: 0,

              maxzoom: 22,

            },

          ]

        },

        center: [114.0143, 33.95236],

        maxZoom: 18,

        zoom: 5.5,

        attributionControl: false,

      });

6月 1 分类:  64次浏览 | 用户: chenxiaoshu (5 分)

1个回答

0 投票
在MapBox的Style里添加一个background类型的图层,设置其背景色为透明即可。
6月 2 用户: 张定祥 名扬四海 (1,492 分)
...