在arcgis js api 3.x版本中,加载geoserver发布的WMTS服务,坐标系包括4326、3857,需要对esri/layers/TiledMapServiceLayer进行扩展
1.4326坐标系,
设置切片的规则,包括比例尺、分辨率等,如果切片叠加存在偏移,在tileInfo中origin设置纠偏值
wmtsLayer.js
define(["dojo/_base/declare",
"esri/layers/TiledMapServiceLayer",
"esri/SpatialReference",
"esri/geometry/Extent",
"esri/layers/TileInfo"
],
function(declare, TiledMapServiceLayer, SpatialReference, Extent, TileInfo) {
return declare("WMTSLayer", [TiledMapServiceLayer], {
constructor: function(options) {
this.options = options;