<?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 Re: Unable to load WMS layer without defining basemap in .NET Maps SDK Questions</title>
    <link>https://community.esri.com/t5/net-maps-sdk-questions/unable-to-load-wms-layer-without-defining-basemap/m-p/1232810#M11486</link>
    <description>&lt;P&gt;Map myMap = new Map(SpatialReferences.WebMercator);&lt;/P&gt;</description>
    <pubDate>Thu, 17 Nov 2022 17:20:03 GMT</pubDate>
    <dc:creator>ZachRuiz</dc:creator>
    <dc:date>2022-11-17T17:20:03Z</dc:date>
    <item>
      <title>Unable to load WMS layer without defining basemap</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/unable-to-load-wms-layer-without-defining-basemap/m-p/1232784#M11484</link>
      <description>&lt;P&gt;I have a WMS layer I need to render in my application but for some reason it does not want to render unless I have set a basemap. This sadly will not work for me as I need the application to work offline I have followed the WMS layer (URL) example to a tee and the only way I can make the layer show is if I have defiend a basemap style.&lt;/P&gt;&lt;P&gt;I have tested that it is possible to add a WMS layer without a basemap by using the example from the sample app and that works fine.&lt;/P&gt;&lt;P&gt;Working Code:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;private readonly Uri _wmsUrlVFR = new Uri("https://wms.chartbundle.com/mp/service?SERVICE=WMS&amp;amp;REQUEST=GetCapabilities");

        
private readonly List&amp;lt;string&amp;gt; _wmsLayerNamesVFR = new List&amp;lt;string&amp;gt; { "sec_3857" };

private async void Initialize()
        {
            Map myMap = new Map(BasemapStyle.ArcGISDarkGray);
            
            // Add the map to the mapview.
            MyMapView.Map = myMap;
        }
 private void Button_Click(object sender, RoutedEventArgs e)
        {
            // Create a new WMS layer displaying the specified layers from the service.
            _VFRChart = new WmsLayer(_wmsUrlVFR, _wmsLayerNamesVFR);
            MyMapView.Map.OperationalLayers.Add(_VFRChart);
        }&lt;/LI-CODE&gt;&lt;P&gt;&lt;SPAN&gt;Not working code:&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;private readonly Uri _wmsUrlVFR = new Uri("https://wms.chartbundle.com/mp/service?SERVICE=WMS&amp;amp;REQUEST=GetCapabilities");

        
private readonly List&amp;lt;string&amp;gt; _wmsLayerNamesVFR = new List&amp;lt;string&amp;gt; { "sec_3857" };

private async void Initialize()
        {
            Map myMap = new Map();
            
            // Add the map to the mapview.
            MyMapView.Map = myMap;
        }
 private void Button_Click(object sender, RoutedEventArgs e)
        {
            // Create a new WMS layer displaying the specified layers from the service.
            _VFRChart = new WmsLayer(_wmsUrlVFR, _wmsLayerNamesVFR);
            MyMapView.Map.OperationalLayers.Add(_VFRChart);
        }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You will see the only difference is line 8&lt;/P&gt;</description>
      <pubDate>Thu, 17 Nov 2022 16:43:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/unable-to-load-wms-layer-without-defining-basemap/m-p/1232784#M11484</guid>
      <dc:creator>ZachRuiz</dc:creator>
      <dc:date>2022-11-17T16:43:56Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to load WMS layer without defining basemap</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/unable-to-load-wms-layer-without-defining-basemap/m-p/1232809#M11485</link>
      <description>&lt;P&gt;Ah, I need to set the spatial reference.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Nov 2022 17:19:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/unable-to-load-wms-layer-without-defining-basemap/m-p/1232809#M11485</guid>
      <dc:creator>ZachRuiz</dc:creator>
      <dc:date>2022-11-17T17:19:49Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to load WMS layer without defining basemap</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/unable-to-load-wms-layer-without-defining-basemap/m-p/1232810#M11486</link>
      <description>&lt;P&gt;Map myMap = new Map(SpatialReferences.WebMercator);&lt;/P&gt;</description>
      <pubDate>Thu, 17 Nov 2022 17:20:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/unable-to-load-wms-layer-without-defining-basemap/m-p/1232810#M11486</guid>
      <dc:creator>ZachRuiz</dc:creator>
      <dc:date>2022-11-17T17:20:03Z</dc:date>
    </item>
  </channel>
</rss>

