Is it possible to add a WMTS layer as a basemap with the use of the ArcGIS Automation API ? I can use the Add Layer method like this to add a WMTS layer to the operational layers :
{
"URI": "https://www.arcgis.com/home/item.html?id=c98ec6ff1b26457db28dfa9ca27f144a",
"target": "operationalLayers",
"type": "PortalItem"
}
But if I try to do the same for baseMaps :
{
"URI": "https://www.arcgis.com/home/item.html?id=c98ec6ff1b26457db28dfa9ca27f144a",
"target": "baseMaps",
"type": "PortalItem"
}
I get this error :
"errorMessage": "Failed to add layer. Invalid request response: Portal item type incorrect"
I know 3 ways of doing this manually.
From the ArcGIS Online tab :
From the Add from Path tab, Portal Item type :
From the Add from Path tab, OGC WMTS type :
But I try to find a way to do it from the Add Layer method of the Automation API. Thank you.
@GeoffroyRicher-Lalonde Thank you for sharing your experience with the ArcGIS Automation API.
The Automation API currently doesn’t fully support adding WMTS data because these services need additional parameters beyond just the URL, such as specifying the layer to use.
When you add a Portal Item as an Operational Layer, it works because the Portal Item already contains these specifications. However, when adding a Portal Item as a Basemap, the Automation API currently only supports the WebMap type as Basemap, not other Portal Item types.
One workaround is to embed your WMTS data inside a WebMap, which can then be added as a basemap. However, if your workflow involves multiple WMTS datasets, converting each one to a WebMap could be time-consuming. Could you share more details about your specific use case? This would help us prioritize improvements to WMTS support in the Automation API.
I noticed the example you provided uses Wayback Imagery. Our upcoming release will include support for historical imagery functionality, which will cover these types of Wayback Imagery datasets.
Thanks,
Yongwei
Hello @YongweiKang, and thank you for your response.
My use case is to let our users easily add the Wayback Imagery as basemaps from an HTML page we develop. I’m glad Wayback will be accessible directly inside ArcGIS Earth in a future release!
For a couple of years, we did exactly what you said: embed the WMTS layers inside web maps and share them from our portal. But it is time-consuming, indeed, and we don’t do it anymore.