WMTS Layer using KVP not loading tiles in 10.2.7

454
3
04-28-2020 10:02 PM
NilankaD
New Contributor II

Hi,

I use ArcGIS .Net SDK 10.2.7 and my application has a mapview which can display the layers added by the user.

https://data.linz.govt.nz/services;key=5169bef47e224d43a935e4283e2d57a6/wmts/1.0.0/set/4769/WMTSCapa... 

The above WMTS previously supported Rest and was working fine. They have changed it to support KVP only and now it's not working as expected. This is my code.

var base_layer = new WmtsLayer(new Uri("https://data.linz.govt.nz/services;key=5169bef47e224d43a935e4283e2d57a6/wmts/1.0.0/set/4769/WMTSCapa... "));

base_layer.DisplayName = "wmts_layer";
base_layer.Layer = "set-4769";
base_layer.ImageFormat = "image/png";
base_layer.Style = "style=2087";
base_layer.ServiceMode = ServiceMode.Kvp;

map_layer.InitializeAsync().ContinueWith(CompleteLayerInitialization, CancellationToken.None,
TaskContinuationOptions.None, TaskScheduler.FromCurrentSynchronizationContext());

I tried the url

https://data.linz.govt.nz/services;key=5169bef47e224d43a935e4283e2d57a6/wmts/1.0.0/set/4769/WMTSCapa... as well.

The layer gets initialized without errors. But I can't see the tiles on the map.

This code worked fine previously when it supported Rest. The only difference was Service mode was set to Rest instead of KVP.

0 Kudos
3 Replies
dotMorten_esri
Esri Frequent Contributor

I don't think KVP was ever that well tested, and I've seen varying implementations of WMTS that can trip up a client.

10.2.7 is out of support at this point, but 100.x release has pretty good WMTS support.

If all else fails, the WMTS layer for 10.2.x is actually open source, so you could grab that and step through it and see if it just needs a tweak or two:

https://github.com/Esri/arcgis-toolkit-sl-wpf/blob/master/src/CommonAPI/API/ESRI.ArcGIS.Client.Toolk...

0 Kudos
NilankaD
New Contributor II

Hi Morten,

Thanks for your prompt reply. 

I tried the code. It needs Esri.ArcGIS.Client.dll. Unfortunately I don't have it anymore as 'Esri.ArcGISRuntime.dll' was sufficient for our recent work.

I cannot download it anymore as 'ArcGIS Runtime SDK for WPF' is labelled as retired.

Is there a way to get the above dll?  

Thanks

0 Kudos
dotMorten_esri
Esri Frequent Contributor

Oops I'm sorry. That source code was for a much much older API (and not 10.2.x). Just ignore what I wrote.

Your best bet is to upgrade your app to 100.7 if possible, as that should give you the best OGC support.

0 Kudos