Select to view content in your preferred language

Determining if MapService is Tiled or Dynamic

744
3
07-11-2013 01:35 PM
Labels (1)
BKuiper
Frequent Contributor
Hi,

How do you determine, in Runtime for WPF, if a MapService is a Tiled or Dynamic MapService ?

I know you can look for the Single Fused Map Cache property on the REST endpoint, but how do I retrieve this property from the object after initialization. I see the msd property on the ArcGISDynamicMapService (MapService.MapServiceInfo) contains this information, but it is hidden.

I would like to load Tiled MapServices with the ArcGISTiledMapService class so i get better performance (i assume that is the case?)

Thanks!
0 Kudos
3 Replies
MichaelBranscomb
Esri Frequent Contributor
Hi,

That's a good question - and I can't see anything in the API which would allow you to determine that. We are investigating improving the service-level metadata for a future release, so I'll make sure that gets consideration too.

There's nothing on either the ArcGISTiledMapServiceLayer class or ArcGISDynamicMapServiceLayer - because by the time you've initialized one of those classes you've already made the decision and currently we don't have a service browser API as such.

If you're working with WebMaps or Portal items there might be something in there that could help?

You could make the REST call yourself (using the ArcGISWebClient class http://resources.arcgis.com/en/help/runtime-wpf/apiref/index.html?ESRI.ArcGIS.Client~ESRI.ArcGIS.Cli...). Then to help process the results you could use something like http://json2csharp.com/ to generate a class from the JSON response.

Alternatively, you could as the default, always try to create an ArcGISTiledMapServiceLayer instance then fall back to an ArcGISDynamicMapServiceLayer if the InitializationFailed event fires (if will be raised if the service doesn't have a cache).

Cheers

Mike
0 Kudos
BKuiper
Frequent Contributor

Alternatively, you could as the default, always try to create an ArcGISTiledMapServiceLayer instance then fall back to an ArcGISDynamicMapServiceLayer if the InitializationFailed event fires (if will be raised if the service doesn't have a cache).


Thank you for your response. I'm doing this right now, but the manual call to the Initialization method take some time and freezes up the UI, so i will probably have to go the JSON route to determine the layer type and then initialize the layer.

It would be nice of all the Metadata would be made available. You are populating it anyway.
0 Kudos
MichaelBranscomb
Esri Frequent Contributor
It would be nice if all the Metadata would be made available. You are populating it anyway.


We'll take that on board - thanks for the feedback.

Cheers

Mike
0 Kudos