Select to view content in your preferred language

Adding WMS Service

5300
20
02-22-2012 06:23 AM
jayshukla
Regular Contributor
Hello There,
Is there a way to add a wms image service in basemap gallery?
Thanks
Jay
0 Kudos
20 Replies
KatherineDalton
Esri Regular Contributor
Hi Jay,

No, only ArcGIS Server Cached (Tiled) map services, Bing Maps, and OpenStreetMap are supported in the Basemap gallery. You can add WMS layers if you like, though. See our Add WMS Layer sample: http://help.arcgis.com/en/webapps/silverlightviewer/samples/start.html

Katy
Katy Dalton | Technical Consultant
THE SCIENCE OF WHERE™
0 Kudos
jayshukla
Regular Contributor
Hi Katy,
I did try to add this as a layer and after specifying login/pwd, it does seem like it is processing but it doesn't add anything? Here is the wms image service that I am trying to add: 

http://www.valtus.ca/wms/servlet/wmsserver?

Appreciate any feedback.
Thanks
Jay
0 Kudos
KatherineDalton
Esri Regular Contributor
Hi Jay - tough to say on this one. Can you step through the code and check that the wmsLayer.Layers property is getting set correctly? Since the ability to add a WmsLayer comes from the main ArcGIS API for Silverlight, you could also try looking through the SL API forums?

Katy
Katy Dalton | Technical Consultant
THE SCIENCE OF WHERE™
0 Kudos
KatherineDalton
Esri Regular Contributor
Hi Jay,

Not sure if you sorted this out, but wanted to let you know that if you are using the sample code we provide, try changing wmsLayer.SetValue(MapApplication.LayerNameProperty, layerName); to MapApplication.SetLayerName(wmsLayer, layerName); At least this should make sure it shows up in the Map Contents if it is being added to the map. Otherwise, with the former, you need to explicitly specify the ID on the wmsLayer.

Katy
Katy Dalton | Technical Consultant
THE SCIENCE OF WHERE™
0 Kudos
jayshukla
Regular Contributor
Hi Katy,

Just wanted to let you know that I am using Builder to add this wms layer, not doing any coding for this. I will into and see what I can get from SL API forum. I still think this is a relevent issue (Builder) that will need resolution.

Thanks
Jay
0 Kudos
KatherineDalton
Esri Regular Contributor
Oh, no, you'll need to have a custom add-in and add the wms layer programmatically. It can't be done through the Builder Browse panel. You can use the sample here: http://help.arcgis.com/en/webapps/silverlightviewer/samples/start.html (It's in the Toolkit section). Let me know if you have questions on this.

Edit: A non-programmatic workaround might be to create a web map in ArcGIS Online that contains the wms layer and then open that in Builder.

Katy
Katy Dalton | Technical Consultant
THE SCIENCE OF WHERE™
0 Kudos
CourtneyBrozovsky
Deactivated User
Hi Katy,

I'm having a similar issue. I am trying to add at least two WMS layers to my web application that I'm building with ArcGIS Viewer for Silverlight. I've dabbled with trying to program an add-in but I'm not certain how to begin with this. The WMS's are not affiliated with our office, so I don't dare post them on ArcGIS Online. Any help would be appreciated, thank you.

-Courtney
0 Kudos
KatherineDalton
Esri Regular Contributor
Hi Courtney,

If you are interested in pursuing the add-in path, you can use the Add WMS Layer sample from the Samples page almost exactly as-is.

  1. Navigate to the Samples page (http://help.arcgis.com/en/webapps/silverlightviewer/samples/start.html), expand the Toolkit heading at the bottom, and click Add WMS Layer.

  2. In the upper-right corner of the sample, click Download Sample. This downloads the sample in a zip file. Extract the files and open the resulting AddWMSLayer.sln in Visual Studio.

  3. Make a few small changes to the existing code as follows:


    • Open the AddWMSLayerDialog.xaml.cs file (code-behind file)

    • Locate the line of code to "Supply the Url to the proxy." Change this to the proxy of the WMS layer server, or if you are unsure, you can comment that line out for now.

    • Remove the line that says "wmsLayer.SetValue(MapApplication.LayerNameProperty, layerName);" and replace it with "MapApplication.SetLayerName(wmsLayer, layerName);".  (Note - we'll be updating this in the online sample soon)

    • Build the solution (Build>Build Solution).

  • Open your Application Builder application and add" rel="nofollow" target="_blank">http://help.arcgis.com/en/webapps/silverlightviewer/help/index.h... the add-in via the Settings menu.

  • Add" rel="nofollow" target="_blank">http://help.arcgis.com/en/webapps/silverlightviewer/help/index.h... the tool to a toolbar.

  • Click the tool on the toolbar to open the dialog, enter the path to the WMS Layer, and click OK.


  • Katy
    Katy Dalton | Technical Consultant
    THE SCIENCE OF WHERE™
    0 Kudos
    CourtneyBrozovsky
    Deactivated User
    Hi Katy,

    Thank you for your help. Unfortunately, when I extract the zipfile I do not get a .sln file. (I'm using Microsoft Visual C# 2010 Express). I've tried editing the xaml.cs file but there was no button or menu to be found that said "build" on it. Any ideas?

    -Courtney
    0 Kudos