美文网首页开源
mapbox-gl调用arcgis切片服务

mapbox-gl调用arcgis切片服务

作者: SarahLee1122 | 来源:发表于2019-12-03 10:06 被阅读0次

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切片服务

    本文链接:https://www.haomeiwen.com/subject/axtcgctx.html