Select to view content in your preferred language

Adding WMS layers

2509
4
07-28-2010 06:17 AM
JayRaja
Emerging Contributor
I have been playing around with WMS layers in a WPF application but am having some difficulty getting any WMS layers to display when using a service not given in the WMS_WPF sample (for v1.2 of the API).

Using either this sample solution or the Toolkit.Datasources assembly in v2.0 I get the same problem. What am I missing?

I have the following piece of xaml nested in the Map.Layers section of the WMS_WPF sample solution

<esriWMS:WMSMapServiceLayer ID="MyLayer" Layers="2909_17518_bg" Url="http://aes.gsfc.nasa.gov/cgi-bin/wms" Opacity="0.7"></esriWMS:WMSMapServiceLayer>

equivalently,

<esriToolkitDS:WmsLayer ID="MyLayer" Layers="2909_17518_bg" Url="http://aes.gsfc.nasa.gov/cgi-bin/wms" Opacity="0.7"></esriToolkitDS:WmsLayer>

in v2.0 of the API.
0 Kudos
4 Replies
KevinDeege
Esri Contributor
I have been playing around with WMS layers in a WPF application but am having some difficulty getting any WMS layers to display when using a service not given in the WMS_WPF sample (for v1.2 of the API).

Using either this sample solution or the Toolkit.Datasources assembly in v2.0 I get the same problem. What am I missing?

I have the following piece of xaml nested in the Map.Layers section of the WMS_WPF sample solution

<esriWMS:WMSMapServiceLayer ID="MyLayer" Layers="2909_17518_bg" Url="http://aes.gsfc.nasa.gov/cgi-bin/wms" Opacity="0.7"></esriWMS:WMSMapServiceLayer>

equivalently,

<esriToolkitDS:WmsLayer ID="MyLayer" Layers="2909_17518_bg" Url="http://aes.gsfc.nasa.gov/cgi-bin/wms" Opacity="0.7"></esriToolkitDS:WmsLayer>

in v2.0 of the API.


Hi, have you set up a cross domain (clientaccesspolicy) that permits this use of this URL?
0 Kudos
JayRaja
Emerging Contributor
Hi, it's not a Silverlight app so I don't need one. The WMS layers given in the ESRI examples work, just nothing else it seems.
0 Kudos
DanielWalton
Frequent Contributor
I use an older version of the WmsLayer code, and when I updated to the latest, it broke. I think there's a problem with the GetCapabilities() method and some WMS sources (not all WMS are equal :)). Get out your Fiddler to see what error the WMS returns.
0 Kudos
JayRaja
Emerging Contributor
Fiddler was the key! I can see that the WMS Server returns an exception as the width / height and the extent specified were inadmissible for the layer.

Using the WMS sample, I can manipulate the values in the query string to use the correct values.
The incorrect extent is slightly irritating as I had specified it in my xaml correctly but when the request is made the values differ.
0 Kudos