WMTSLayer WKID

545
1
10-29-2017 08:38 PM
AdamMaps84
New Contributor

Hi

I am trying a to add support of reading OGC services to a solution we are building, so the first guess is to use  "esri/layers/WMTSLayer" class. First thing noticed is that the service is not an actual service, rather it is a directory of image/tiled services. 
I encountered the following issues:
- the base map we are using "World_Imagery" has "102100" spatial reference wkid, while the #OGC service we are testing to use has spatial ref wkid "4326", which caused lot of JS errors from within the WMTSLayer api class

- i changed the scenario to use base map and OGC service with the same wkid, and the error disappeared and i can see both services on the map-view

Now I want to force limiting adding OGC services to the app unless the service has wkid identical to the base map's. The problem is that the WMTSLayer object that got filled after the layer is loaded has always wkid value of "4326", although I am using the service of wkid "3857" projection. Is there a way to get the correct WKID of the #WMTSLayer object?

0 Kudos
1 Reply
DavidBlanchard
Esri Contributor

I believe you should be able to do a GetCapabilities operation on the WMTS service just like you can with a WMS service. If so, just get that data ahead of time before creating the layer in the ArcGIS API. You could then check the returned XML for the appropriate projection data. Spatial references are usually prefixed with "EPSG".