Select to view content in your preferred language

Adding wms layer from geoserver

2800
4
08-09-2011 05:11 AM
devrim_barisacar
Emerging Contributor
Hi,
I have some questions regarding to adding a  wms layer from geoserver to a silverlight based map.

First problem is, I cannot delete the esri basemap(ArcGISTiledMapServiceLayer, please see below). If I do that , my wms layer also disappears.  You can see my XAML page below;

[INDENT]<UserControl x:Class="SilverlightApplication5.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:esri="http://schemas.esri.com/arcgis/client/2009" >

    <Grid x:Name="LayoutRoot">
        <esri:Map WrapAround="True" >
            <esri:WmsLayer  ID="WMS Layer" Layers="nurc:Img_Sample" Url="http://localhost:8080/geoserver/wms" Opacity="1" SupportedSpatialReferenceIDs="3857"  SkipGetCapabilities="True" Version="1.3" />
            <esri:ArcGISTiledMapServiceLayer Url="http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer" Opacity="0.7"  />
        </esri:Map>
    </Grid>
</UserControl>[/INDENT]


In this way I can see my wms layer on map, but if I delete the ArcGISTiledMapServiceLayer  , then my geoserver wms layer also disappears.

Do you have any recommendations?

PS I am using win7 ult. with visual studio 2010, esri silverlight api 2.2 and geoserver 2.1.1.

best regards
baris
0 Kudos
4 Replies
DorothyMortenson
Deactivated User
Have you tried to bring your WMS into ArcMap as the first layer, then add the esri layer second?  This may give you some idea of what is going on about map extent/projections, etc.
0 Kudos
devrim_barisacar
Emerging Contributor
Have you tried to bring your WMS into ArcMap as the first layer, then add the esri layer second?  This may give you some idea of what is going on about map extent/projections, etc.


Yes, in fact my config file is in this config already, i have tried both configs.
0 Kudos
devrim_barisacar
Emerging Contributor
I have solved the problem using a clientaccesspolicy.xml in geoserver jetty installation. I did not think of this may be the problem since I could see the layer when using it with a basemap...
0 Kudos
ArneDahlman
Regular Contributor
Maybe the map gets the wrong spatialreference.
The first (the undermost) layer added to the map determines what spatialreference to be used.

Try to explicitly set the WKID in codebehind.

For example, in YourMap_Progress
set
YourMap.SpatialReference.WKID = <your wkid>
0 Kudos