Select to view content in your preferred language

Silverlight client using ArcGIS API to process non ArcGIS WMS sources

3005
3
10-21-2011 12:24 PM
ChrisBartek
New Contributor
Hi everyone,

I want to create a silverlight mapping application that queries my own WMS webservice (mapserver, not ArcGIS). This would be a pretty simple application, zoom in and out, pan, layers on/off.

I was wondering if the ArcGIS API for Silverlight is the way to go here. I know it is FOR ArcGIS, but as far as I know, WMS services need to provide the client with capabilities (GetCapabilities) and return a MAP (GetMap). So I was hoping, instead of writing the entire client in Silverlight from scratch, to use the ArcGIS API for Silverlight for all of this.

Is this possible? Is the API robust enough to manipulate the GetMap call based on info from GetCapabilities, without having to parse everything out yourself? Does it also provide controls for basic map manipulation?


If not, does anyone know what is the best way of using Silverlight for such a task?

Thanks!

Chris
0 Kudos
3 Replies
TerryGiles
Frequent Contributor
Chris,

The ESRI silverlight toolkit contains a class for displaying WMS services - see http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#WmsLayerSimple for a sample and CodePlex to download the toolkit - http://esrisilverlight.codeplex.com/documentation.  I've never looked at the source code for the toolkit but I'm guessing it handles all of the GetMap requests for you..

One thing to note though is that the WMSLayer class in the toolkit does not support the ability to Identify (GetFeatureInfo in WMS terms) on a WMS layer.  I implemented my own WCF service to handle this which was pretty straight forward -

- Pass the info (e.g. map extent, spatial reference, layers to query, etc...) you need to perfrom a WMS GetFeatureInfo request** from the Silverlight client to the service;

- in the WCF service, build a URL containing the GetFeatureInfo request and use WebClient.OpenRead() to stream the results.

-pass back to the client the results and handle as needed.

**Note there are differences between WMS versions on the required parameters, their names, and for the BBox, the order of the parameters.  I found a nice summary table between versions 1.1 and 1.3 somewhere on either the OGC or ESRI website, but don't recall where.


Hope this helps,
Terry
0 Kudos
ChrisBartek
New Contributor
Hi Terry,

Thank you for your reply. This helps a lot.

Another question I have is whether this Silverlight API is distributed for free? I do not need an ArcServer license with it do I? As I mentioned I'd like to access non ArcServer WMS services. Would this be a problem?

thanks,

Chris
0 Kudos
TerryGiles
Frequent Contributor
Chris,

You don't need ArcGIS Server installed to use the Silverlight API - you can use your WMS services and/or map services from other providers, such as ESRI's ArcGIS online.

"Is the API free" - well, in general I'd say yes, but encourage you to read the License Agreement when you download it to make sure you intended use meets their terms.
0 Kudos