hi folks
im trying to implement a public wmts layer (https://wmts.geo.admin.ch/EPSG/2056/1.0.0/WMTSCapabilities.xml).
with this code:
let wmtsService = AGSWMTSService(url: URL(string("https://wmts.geo.admin.ch/EPSG/2056/1.0.0/WMTSCapabilities.xml")))
//load the WMTS service to access the service information
wmtsService.load { (error) in
if let error = error {
DDLogError("Failed to load wmts basemap. \(error)")
} else if let layerInfo = wmtsService.serviceInfo?.layerInfos.first(where: { $0.layerID == "ch.swisstopo.pixelkarte-farbe"}) {
let wmtsLayer = AGSWMTSLayer(layerInfo: layerInfo)
let basemap = AGSBasemap(baseLayer: wmtsLayer)
completionHandler(basemap)
}
}
The WMTS Service is loading without error but the Basemap doesn't display anything.
So i debugged it with Postman. The Layer is trying to load the tiles from an URL like this:
https://wmts.geo.admin.ch/1.0.0/ch.swisstopo.pixelkarte-farbe/default//21781/20/58/70.jpeg
causing a 404 because the <Time> parameter is empty.
The correct URL would be https://wmts.geo.admin.ch/1.0.0/ch.swisstopo.pixelkarte-farbe/default/current/21781/20/58/70.jpeg
How can i force the WMTSLayer to provide the "current" keyword to the <Time> parameter?
Thanks a lot!
Mike