How to customize TileInfo using WMTS Service in WMTSLayer using ArcGIS API for JavaScript 4.5

1013
0
11-23-2017 06:50 AM
shengnangu1
New Contributor

 ArcGIS API for JavaScirpt:Version 4.5

It is not a issue with the CORS because I have already using the proxy to access the WMTS map service which location is: http://t0.tianditu.com/vec_c/wmts, you could use KVP serviceMode to load this service using WMTSLayer.

I am using the API to load a WMTS service from "天地图"(Coordinate System: CGS2000 - wkid:4490), the WMTS parameter of this service is slightly different from the OGC WMTS Standard (the DPI、scale and resolution is different). Which caused the shifting of the map to its real location. I tried two ways to solve this issue but both did not work as I expect, which are:

  • Add a customized WMTSSubLayer to WMTSLayer

       When I tried to new a instance of WMTSSubLayer using the code below:

var wmtsSublayer = new WMTSSublayer({
   description: "descript",
   fullExtent: mapExtent,
   id: "tianditu_vec",
   imageFormat: "image/png",
   / / layer: wmtsLayer,
   tileMatrixSet: mapTileMatrixSet,
   title:"tianditu"
});

      I encounterd: Uncaught TypeError: [accessor] cannot assign to read-only property 'tileMatrixSet' of esri.layers.support.WMTSSublayer

      And then I tried to put the mapTileMatrixSet into a Array and give it the tileMatrixSets field, it turns out that the API is unable to find it. So I stopped and don't know what to do next.

  • Using BaseTileLayer to create the customized TileLayer

      Using this method the map could be loaded but the latitude is shifting a lot from its real value, and the map looks like below:

It seems that the map is moving towards north a lot. 

Could anyone please help me with this problem? Thanks a lot. 

0 Kudos
0 Replies