Select to view content in your preferred language

load a special wms server map in WPF

3513
1
Jump to solution
12-14-2015 11:58 PM
Labels (1)
BaharAzartoos
Deactivated User

Hi Dears

I can load all of these links in arcmap. These links are WMS server.

  1. http://mesonet.agron.iastate.edu/cgi-bin/wms/nexrad/n0r.cgi http://openwms.statkart.no/skwms1/wms.sjo_hovedkart2
  2. http://www.gebco.net/data_and_products/gebco_web_services/web_map_service/mapserv?request=getmap&ser...
  3. http://www.richlandmaps.com/geoserver/wms/
  4. MapServer Message

I want to use these servers in WPF. I want to load a WMS server in WPF and use it.

this is my xaml code:

<Window x:Class="MAP_Mary.MainWindow"  xmlns:esri="http://schemas.esri.com/arcgis/client/2009"

        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

        Title="MainWindow" Height="350" Width="525">

       

    <Grid x:Name="LayoutRoot" Background="White">

        <esri:Map x:Name="MyMap" Extent="-130,10,-70,60" >

        </esri:Map>

        <Button Content="Button" HorizontalAlignment="Left" Margin="10,10,0,0" VerticalAlignment="Top" Width="75" Click="Button_Click"/>

    </Grid>

</Window>

this is my background code:

var wmsLayer = new WmsLayer()

            {

               Url="http://openwms.statkart.no/skwms1/wms.sjo_hovedkart2?",

               Layers = new string[] { "overview" },

            };

            MyMap.Layers.Add(wmsLayer);

this code works for links(1,2), but unfortunetly, it doesn`t work for links (3,4). it can`t show the layer in links (3,4).

please help me, I really need your help.

sincerely

Tags (4)
0 Kudos
1 Solution

Accepted Solutions
BaharAzartoos
Deactivated User

Fortunately, I found the answer. I put a tile map server as background under the layer. It fixed the problem.

<esri:Map x:Name="MyMap" ZoomDuration="00:00:00" PanDuration="00:00:00">

            <esri:Map.Layers>

                <esri:ArcGISTiledMapServiceLayer ID="StreetMapLayer"

              Url="http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer" />

            </esri:Map.Layers>

    </esri:Map>

Good Luck

View solution in original post

0 Kudos
1 Reply
BaharAzartoos
Deactivated User

Fortunately, I found the answer. I put a tile map server as background under the layer. It fixed the problem.

<esri:Map x:Name="MyMap" ZoomDuration="00:00:00" PanDuration="00:00:00">

            <esri:Map.Layers>

                <esri:ArcGISTiledMapServiceLayer ID="StreetMapLayer"

              Url="http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer" />

            </esri:Map.Layers>

    </esri:Map>

Good Luck

0 Kudos