Select to view content in your preferred language

Add WMTS Service to Scene

1184
3
Jump to solution
07-22-2022 05:33 AM
MartinPorteš
Occasional Contributor

Hi, 

I'm working with API JS4.xx and I need to create a scene with WMTS layer inserted into it. Is that possible? I cannot find any sample combining WMTS and Scene view.

I'm able to accomplish this using Portal for ArcGIS where I created WMTS item, then created scene (without original basemap, just with WMTS) and then to create WebScene using this portalItem. That works, but I loose the original basemap I have as default in Portal for ArcGIS. 

The error I recieve when I try to add new WMTSLayer created via JS is: The tiling scheme of this layer is not supported by SceneView. Is there any workaround?

Thank you for any help!

Martin Porteš

0 Kudos
1 Solution

Accepted Solutions
AnneFitz
Esri Regular Contributor

Hi, yes this is possible. Here is an example: https://codepen.io/annefitz/pen/YzaQQwL

Just make sure the WMTSLayer is available in the same spatial reference of your SceneView - this is most likely why you are getting the tiling scheme error.

View solution in original post

3 Replies
AnneFitz
Esri Regular Contributor

Hi, yes this is possible. Here is an example: https://codepen.io/annefitz/pen/YzaQQwL

Just make sure the WMTSLayer is available in the same spatial reference of your SceneView - this is most likely why you are getting the tiling scheme error.

MartinPorteš
Occasional Contributor

Hi,

I'm sure your example works, but I'm strugling with coors policy problems to load the WMTS layer, but It's clear enough of an example that I can understand what you mean.

Still I'm struggling with my solution. The problem is, that since I'm in Czech Republic, I'm working with wkid 5514 or 102067 (older code) and service from national portal https://ags.cuzk.cz/arcgis/rest/services/ortofoto/MapServer/WMTS/1.0.0/WMTSCapabilities.xml. Would you mind spending few more minutes to put these two together? The scene should be local, not sure if that changes things.

Anyway I'm accepting the solution, thank you so much! And I'd appreciate help with this exact service, if possible.

 

Martin

 

0 Kudos
GreteSoosalu
Esri Contributor

Hi Martin, 

Looking deeper into the console errors the service you use shows, we see that the there are too many root tiles and the error message explains it a bit more in detail: "Scale of level 0 of the tiling scheme (1:3,870,727) is too large for the layer's extent. Suggested scale: 1:600,000,000."

Unfortunately, as you mention that it is a national service, there is no workaround we can recommend. If it was your own data, we would normally suggest to republish the service taking into account the tiling scheme requirements for scenes: 

  • 256x256 or 512x512 pixel tiles
  • Scale levels must increase or decrease by a power of two
  • At level 0 there shouldn't be more than 30 root tiles.
  • All tiled layers must have the same tiling scheme and SpatialReference.

The last point also means that if you want to combine a WMTS layer with a basemap, you would need to make sure they both use the same tiling scheme

0 Kudos