How to load WMTS service with a customed tileinfo

1051
1
10-26-2017 09:03 AM
yinxiaofei
New Contributor

How to load “天地图”(a tile map serivce ,following socalled OGC standards, but the tilematrixset and dpi are unique) with arcgis api for javascript v4.5?

I have tried two ways to load tianditu using javascript v4.5 ,and neither carried out right.

The first one, I used the WMTSLayer to load the tianditu, but the coordinate was wrong with a big deviation.

Another one turn out a different coordinate system which looks like a projecting goesystem.

What's the problems? Is there any right method to load the tianditu? 

Here is the code:GitHub - yxfcn/tiandituv45: load tianditu with arcgis api for javascript v4.5 

0 Kudos
1 Reply
DavidBlanchard
Esri Contributor

The most common issue with WMTS layers is with the GetCapabilities request which returns an XML file. If that XML file is located on a server that is different then the one serving your application, it will be blocked by the browser. This is because XML files are not supported for CORS.

You can find whether that is the issue by opening your browser's developer console (usually with F12 on Windows). After reloading the page, you might find an error there indicating that a request was blocked for security reasons.

If that is the case, try using a proxy page.