Log loading errors from custom WM(T)S services

740
2
Jump to solution
01-06-2021 01:52 AM
Selsoe
by
New Contributor III

I have a map where I load map from a third party WMTS service and overlays from another third party WMS Service. I experience timout errors from these services from time to time. They are printed in the log, but is there a way to get notified about these loading errors in a callback so I can log them myself?

 

I use the load function on AGSWMTSService (similarly on AGSWMSService) and it loads with an optional error object. This loads fine - it is only when navigating the map and tiles have to load individually that it sometimes fails loading some tiles with timeouts.

Tags (2)
1 Solution

Accepted Solutions
Nicholas-Furness
Esri Regular Contributor

You can set up a layer status change handler on AGSMapView (or AGSSceneView). By listening to this, you can get status updates for layers as you navigate the map.

You would want to look at the status property on the AGSLayerViewState object that is provided for the layer(s) in question. This is an enum of type AGSLayerViewStatus. You should keep an eye out for a status of warning, which means Runtime was able to communicate with the service, but there was a problem getting some data. The AGSLayerViewState object also has an error property which will give you more info about the warning status, but see the documentation for more details.

Hope that helps.

View solution in original post

2 Replies
Nicholas-Furness
Esri Regular Contributor

You can set up a layer status change handler on AGSMapView (or AGSSceneView). By listening to this, you can get status updates for layers as you navigate the map.

You would want to look at the status property on the AGSLayerViewState object that is provided for the layer(s) in question. This is an enum of type AGSLayerViewStatus. You should keep an eye out for a status of warning, which means Runtime was able to communicate with the service, but there was a problem getting some data. The AGSLayerViewState object also has an error property which will give you more info about the warning status, but see the documentation for more details.

Hope that helps.

Selsoe
by
New Contributor III

Exactly what I was looking for. Thank you.

0 Kudos