arcgis加载wtms数据
Posted 友人A
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了arcgis加载wtms数据相关的知识,希望对你有一定的参考价值。
这是wtms服务地址,一定要记得加tile
http://***.***.***.***:6080/arcgis/rest/services/***/***/MapServer/tile/
export const CustomWMTS = async (val) => {
let BaseTileLayer = await arcgisPackage.BaseTileLayer;
let Request = await arcgisPackage.Request;
let TDT = await BaseTileLayer.createSubclass({
properties: {
urlTemplate: null,
layerType:\'wmts\'
},
getTileUrl: function (level, row, col) {
let url =val + level + \'/\' + row + \'/\' + col
return url;
},
fetchTile: function (level, row, col) {
let url = this.getTileUrl(level, row, col);
return Request(url, {
responseType: "image",
}).then((response) =>{
let image = response.data;
let width = this.tileInfo.size[0];
let height = this.tileInfo.size[0];
let canvas = document.createElement("canvas");
let context = canvas.getContext("2d");
canvas.width = width;
canvas.height = height;
context.drawImage(image, 0, 0, width, height);
return canvas;
})
},
});
let layer = await new TDT();
return layer
}
以上是关于arcgis加载wtms数据的主要内容,如果未能解决你的问题,请参考以下文章