<?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 Layer not loading, custom TiledLayer implementation in .NET Maps SDK Questions</title>
    <link>https://community.esri.com/t5/net-maps-sdk-questions/layer-not-loading-custom-tiledlayer-implementation/m-p/411831#M4892</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have written a custom tile layer class that extends TiledLayer, using Esri.ArcGISRuntime Desktop API for .NET, version 10.2.7.0. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm trying to test the implementation in a single layer on a single map in a single map view:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Map myMap = new Map();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CustomTilesLayer newLayer= new &lt;SPAN style="color: rgba(0, 0, 0, 0); font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt;CustomTilesLayer&lt;/SPAN&gt;();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; myMap.Layers.Add(newLayer);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MyMapView.Map = myMap;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I run the application, I can see that the OnInitializeTiledLayerRequestedAsync() method of CustomTilesLayer is being called and returns a task, but it never invokes the task and I don't know why.&amp;nbsp; The application displays a blank white map with the Esri logo. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I instead try to load the layer asynchronously:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;await newLayer.InitializeAsync();&lt;/PRE&gt;&lt;P&gt;the application hangs on the await command.&amp;nbsp; Again, the task is not invoked (and the blank white map with the Ersi logo still displays).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's the method:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;protected override Task&amp;lt;TiledLayerInitializationInfo&amp;gt; OnInitializeTiledLayerRequestedAsync()
{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return new Task&amp;lt;TiledLayerInitializationInfo&amp;gt;(InitializeTileInfo);
}&lt;/PRE&gt;&lt;P&gt;(As written in the custom class, the task invokes a private method InitializeTileInfo() that creates tile initialization information about the scaling and extent, etc.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas why the task is not invoked?&lt;/P&gt;&lt;P&gt;Also, currently my tile layer class has an empty constructor.&amp;nbsp; Is there something else that needs to be defined in my tile layer class?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 18:41:30 GMT</pubDate>
    <dc:creator>MichelleArmstrong</dc:creator>
    <dc:date>2021-12-11T18:41:30Z</dc:date>
    <item>
      <title>Layer not loading, custom TiledLayer implementation</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/layer-not-loading-custom-tiledlayer-implementation/m-p/411831#M4892</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have written a custom tile layer class that extends TiledLayer, using Esri.ArcGISRuntime Desktop API for .NET, version 10.2.7.0. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm trying to test the implementation in a single layer on a single map in a single map view:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Map myMap = new Map();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CustomTilesLayer newLayer= new &lt;SPAN style="color: rgba(0, 0, 0, 0); font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt;CustomTilesLayer&lt;/SPAN&gt;();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; myMap.Layers.Add(newLayer);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MyMapView.Map = myMap;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I run the application, I can see that the OnInitializeTiledLayerRequestedAsync() method of CustomTilesLayer is being called and returns a task, but it never invokes the task and I don't know why.&amp;nbsp; The application displays a blank white map with the Esri logo. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I instead try to load the layer asynchronously:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;await newLayer.InitializeAsync();&lt;/PRE&gt;&lt;P&gt;the application hangs on the await command.&amp;nbsp; Again, the task is not invoked (and the blank white map with the Ersi logo still displays).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's the method:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;protected override Task&amp;lt;TiledLayerInitializationInfo&amp;gt; OnInitializeTiledLayerRequestedAsync()
{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return new Task&amp;lt;TiledLayerInitializationInfo&amp;gt;(InitializeTileInfo);
}&lt;/PRE&gt;&lt;P&gt;(As written in the custom class, the task invokes a private method InitializeTileInfo() that creates tile initialization information about the scaling and extent, etc.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas why the task is not invoked?&lt;/P&gt;&lt;P&gt;Also, currently my tile layer class has an empty constructor.&amp;nbsp; Is there something else that needs to be defined in my tile layer class?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 18:41:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/layer-not-loading-custom-tiledlayer-implementation/m-p/411831#M4892</guid>
      <dc:creator>MichelleArmstrong</dc:creator>
      <dc:date>2021-12-11T18:41:30Z</dc:date>
    </item>
  </channel>
</rss>

