mapbox-gl调用arcgis切片服务

1.首先arcmap发布瓦片服务[WMTS服务]
2.mapbox调用服务地址为

"http://localhost:6080/arcgis/rest/services//service_name/MapServer/tile/{z}/{y}/{x}"

3.代码片段

map = new mapboxgl.Map({
              container: this.$refs.map,
              maxZoom: 17,
              maxBounds: [[115.0734631836064, 33.460859436981664], [118.40116659204773, 35.49882586674076]],
              style: {
                version: 8,
                sprite: "http://localhost/mapbox/images/iocMapIocn",
                glyphs: "http://localhost/mapbox/font/{fontstack}/{range}.pbf",
                name: "mapboxdata",
                center: [116.68503, 34.595113],
                zoom: 9,
                sources: {
                  arcgissource: {
                    type: "raster",
                    tiles: ["http://localhost:6080/arcgis/rest/services//service_name/MapServer/tile/{z}/{y}/{x}"],
                    tileSize: 256
                  }
                },
                layers: [
                  {
                    id: "test",
                    type: "raster",
                    source: "arcgissource",
                    minzoom: 0,
                    maxzoom: 18
                  }
                ]
              }
            });

你可能感兴趣的:(mapbox-gl调用arcgis切片服务)