<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Issue in Displaying WMS Layer with Different Spatial Reference on Map in .NET Maps SDK Questions</title>
    <link>https://community.esri.com/t5/net-maps-sdk-questions/issue-in-displaying-wms-layer-with-different/m-p/1368250#M12446</link>
    <description>&lt;P&gt;In WPF application I am encountering difficulties displaying a WMS layer using .Net Maps SDK(200.2) when the layer and the map have different spatial references.&lt;/P&gt;&lt;P&gt;If I create the map and WMS layer both with a spatial reference of 4326(wms layer has this), everything displays correctly.&lt;BR /&gt;However, when I attempt to create the map with a spatial reference of 3857 and load the WMS layer with spatial reference 4326, the layer does not display.&lt;/P&gt;&lt;P&gt;How can I properly handle the display of layer if it has a different spatial reference from map&lt;/P&gt;&lt;P&gt;Here's the snippet of the code:&lt;/P&gt;&lt;P&gt;private async void DisplayWMSLayer(object sender, RoutedEventArgs e)&lt;BR /&gt;{&lt;BR /&gt;Uri _wmsUrl = new Uri("&lt;A href="https://crop.csiss.gmu.edu/cgi-bin/wms_cdl_ia" target="_blank"&gt;https://crop.csiss.gmu.edu/cgi-bin/wms_cdl_ia&lt;/A&gt;?");&lt;BR /&gt;&lt;BR /&gt;List&amp;lt;string&amp;gt; layerNames = new List&amp;lt;string&amp;gt;();&lt;BR /&gt;string strSelectedLayerName = "cdl_2020_ia";&lt;BR /&gt;layerNames.Add(strSelectedLayerName);&lt;BR /&gt;WmsLayer wmsLayer = new WmsLayer(_wmsUrl, layerNames);&lt;BR /&gt;await wmsLayer.LoadAsync();&lt;BR /&gt;SpatialReference mapSpatialReference = SpatialReference.Create(3857);//if i use 4326 then display layer correctly&lt;BR /&gt;Map nMap = new Map(mapSpatialReference);&lt;/P&gt;&lt;P&gt;nMap.OperationalLayers.Add(wmsLayer);&lt;BR /&gt;nMap.InitialViewpoint = new Viewpoint(wmsLayer.FullExtent);&lt;BR /&gt;MainMapView.Map = nMap;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 10 Jan 2024 08:31:37 GMT</pubDate>
    <dc:creator>Muhammadkhalid</dc:creator>
    <dc:date>2024-01-10T08:31:37Z</dc:date>
    <item>
      <title>Issue in Displaying WMS Layer with Different Spatial Reference on Map</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/issue-in-displaying-wms-layer-with-different/m-p/1368250#M12446</link>
      <description>&lt;P&gt;In WPF application I am encountering difficulties displaying a WMS layer using .Net Maps SDK(200.2) when the layer and the map have different spatial references.&lt;/P&gt;&lt;P&gt;If I create the map and WMS layer both with a spatial reference of 4326(wms layer has this), everything displays correctly.&lt;BR /&gt;However, when I attempt to create the map with a spatial reference of 3857 and load the WMS layer with spatial reference 4326, the layer does not display.&lt;/P&gt;&lt;P&gt;How can I properly handle the display of layer if it has a different spatial reference from map&lt;/P&gt;&lt;P&gt;Here's the snippet of the code:&lt;/P&gt;&lt;P&gt;private async void DisplayWMSLayer(object sender, RoutedEventArgs e)&lt;BR /&gt;{&lt;BR /&gt;Uri _wmsUrl = new Uri("&lt;A href="https://crop.csiss.gmu.edu/cgi-bin/wms_cdl_ia" target="_blank"&gt;https://crop.csiss.gmu.edu/cgi-bin/wms_cdl_ia&lt;/A&gt;?");&lt;BR /&gt;&lt;BR /&gt;List&amp;lt;string&amp;gt; layerNames = new List&amp;lt;string&amp;gt;();&lt;BR /&gt;string strSelectedLayerName = "cdl_2020_ia";&lt;BR /&gt;layerNames.Add(strSelectedLayerName);&lt;BR /&gt;WmsLayer wmsLayer = new WmsLayer(_wmsUrl, layerNames);&lt;BR /&gt;await wmsLayer.LoadAsync();&lt;BR /&gt;SpatialReference mapSpatialReference = SpatialReference.Create(3857);//if i use 4326 then display layer correctly&lt;BR /&gt;Map nMap = new Map(mapSpatialReference);&lt;/P&gt;&lt;P&gt;nMap.OperationalLayers.Add(wmsLayer);&lt;BR /&gt;nMap.InitialViewpoint = new Viewpoint(wmsLayer.FullExtent);&lt;BR /&gt;MainMapView.Map = nMap;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jan 2024 08:31:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/issue-in-displaying-wms-layer-with-different/m-p/1368250#M12446</guid>
      <dc:creator>Muhammadkhalid</dc:creator>
      <dc:date>2024-01-10T08:31:37Z</dc:date>
    </item>
    <item>
      <title>Re: Issue in Displaying WMS Layer with Different Spatial Reference on Map</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/issue-in-displaying-wms-layer-with-different/m-p/1368652#M12449</link>
      <description>&lt;P&gt;I believe the WMS service defines a list of supported spatial references that you can use. If you check the capabilities for the service here:&amp;nbsp;&lt;A href="https://crop.csiss.gmu.edu/cgi-bin/wms_cdl_ia/cdl_2020_ia/wms?SERVICE=WMS&amp;amp;REQUEST=GetCapabilities" target="_blank"&gt;https://crop.csiss.gmu.edu/cgi-bin/wms_cdl_ia/cdl_2020_ia/wms?SERVICE=WMS&amp;amp;REQUEST=GetCapabilities&lt;/A&gt;&lt;/P&gt;&lt;P&gt;You'll see that the layers define the following spatial references (CRS):&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;CRS&amp;gt;epsg:5070&amp;lt;/CRS&amp;gt;
&amp;lt;CRS&amp;gt;epsg:102004&amp;lt;/CRS&amp;gt;
&amp;lt;CRS&amp;gt;epsg:4326&amp;lt;/CRS&amp;gt;&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 10 Jan 2024 21:46:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/issue-in-displaying-wms-layer-with-different/m-p/1368652#M12449</guid>
      <dc:creator>ThadTilton</dc:creator>
      <dc:date>2024-01-10T21:46:04Z</dc:date>
    </item>
  </channel>
</rss>

