Select to view content in your preferred language

Single WMS layer in map not displayed

1707
10
Jump to solution
03-26-2012 03:07 AM
MarkusHjärne
Deactivated User
Hi,

when I have a map with just a single WmsLayer added in XAML, the layer is not displayed. I've tried to set the map's spatial reference by explicitly settings the map's extent to an envelope with the correct spatial reference in XAML, but it has no effect.

But if I add another non-WMS layer to the map in XAML, under or above the WmsLayer, the WmsLayer is displayed.

I'm using version 2.4 of the Silverlight API version.

How can I display just a single WmsLayer in a map?


Best Regards
Markus Hjärne
0 Kudos
1 Solution

Accepted Solutions
DominiqueBroux
Esri Frequent Contributor
I would appreciate to know if this is a bug that might be fixed in a future version or if it's really by design (and in that case the reason why).


I created a new work item in the todo stack but I can't give you more info for the moment.

Thanks for reporting that.

View solution in original post

0 Kudos
10 Replies
DominiqueBroux
Esri Frequent Contributor
I've tried to set the map's spatial reference by explicitly settings the map's extent to an envelope with the correct spatial reference in XAML, but it has no effect.


That should work. Just check that the spatial reference you set is supported by the WMS layer.

Note : If this is not working and that your WMS layer is public, share the URL so I can test from here.
0 Kudos
MarkusHjärne
Deactivated User
Unfortunately our WMS service isn't public.

But I tried it with the WMS layer in your online sample (http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#WmsLayerSimple) and discovered that it worked when SkipGetCapabilities is False (as in the sample), but not when it is True:

[HTML]<esri:Map WrapAround="True">
<esri:Map.Extent>
  <esri:Envelope XMin="-15000000" YMin="2000000" XMax="-7000000" YMax="8000000">
   <esri:Envelope.SpatialReference>
    <esri:SpatialReference WKID="102100" />
   </esri:Envelope.SpatialReference>
  </esri:Envelope>
</esri:Map.Extent>

            <esri:WmsLayer ID="OtherWMSLayer"                     
                           Url="http://mesonet.agron.iastate.edu/cgi-bin/wms/nexrad/n0r.cgi"                    
                           ProxyUrl="http://serverapps.esri.com/SilverlightDemos/ProxyPage/proxy.ashx"                    
                           SkipGetCapabilities="True"                    
                           Layers="nexrad-n0r"
                           Version="1.1.1"
                           Opacity="0.7" />
</esri:Map>[/HTML]The reason I need to set SkipGetCapabilities to True is that the WMS server doesn't have a Client Access Policy file and we cannot easily add one since it isn't our server.

In the example above I also tried to set SupportedSpatialReferenceIDs = "102100" on the WmsLayer, but that didn't help either.

Any ideas?
0 Kudos
DominiqueBroux
Esri Frequent Contributor
But I tried it with the WMS layer in your online sample (http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#WmsLayerSimple) and discovered that it worked when SkipGetCapabilities is False (as in the sample), but not when it is True:

Should work with SkipGetCapabilities=true.
Which version are you using?


The reason I need to set SkipGetCapabilities to True is that the WMS server doesn't have a Client Access Policy file and we cannot easily add one since it isn't our server.

Yes it's a possible reason. The workaround may be to use a proxy .

but that didn't help either.

Any ideas?

Check that your layer nameexists,else I suggest you to use fiddler to look at requests sent to the server. That might give a clue.
0 Kudos
MarkusHjärne
Deactivated User
If I just another layer to the map, the WMS layer starts working, so I know there is no problem with the access to the WMS layer (and I am using a proxy to add credentials to the request).

You can repeat my problem with the sample XAML with the ESRI WMS Service I included in the previous post.

/Markus
0 Kudos
DominiqueBroux
Esri Frequent Contributor
I got the issue.
It looks like a map can't be displayed if there is no layer in the map having a FullExtent (and a wms layer with SkipGetCapabilities to true has no full extent).
Not sure if it's a bug or by design.

The workaround might be to keep another layer in the map with a visibility set to false. Not ideal but...
0 Kudos
MarkusHjärne
Deactivated User
Thanks for your help, at least I know now it's nothing I do wrong and how to workaround the problem.

But it seems odd that the layer cannot be displayed even when I explicitly set the map's extent.

I would appreciate to know if this is a bug that might be fixed in a future version or if it's really by design (and in that case the reason why).

/Markus
0 Kudos
DominiqueBroux
Esri Frequent Contributor
I would appreciate to know if this is a bug that might be fixed in a future version or if it's really by design (and in that case the reason why).


I created a new work item in the todo stack but I can't give you more info for the moment.

Thanks for reporting that.
0 Kudos
DominiqueBroux
Esri Frequent Contributor
For information, this issue will be fixed in the next version of the API.
0 Kudos
christophernewbill
Emerging Contributor
Realize this is an older thread, but not so old I am not replying. 🙂

I assume this issue also applies to the WPF SDK, since I remember reading they essentially share the same code base.

When will the next version be out? Running into this issue as well.
0 Kudos