<?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: Changing basemap from service to tile cache does not work in .NET Maps SDK Questions</title>
    <link>https://community.esri.com/t5/net-maps-sdk-questions/changing-basemap-from-service-to-tile-cache-does/m-p/625900#M7652</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I find the solution I documented above to be a lot of code for something I think should be pretty simple.&amp;nbsp; It is also unstable and at times switching basemaps will freeze.&amp;nbsp; The best fix would be to have basemaps in the same projection, but in our case that is not possible. We have purchased tile imagery that is delivered only in the local projection, and would like to also be able to use online basemaps, only available in specific projections&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 04 Jan 2018 15:17:03 GMT</pubDate>
    <dc:creator>JoeHershman</dc:creator>
    <dc:date>2018-01-04T15:17:03Z</dc:date>
    <item>
      <title>Changing basemap from service to tile cache does not work</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/changing-basemap-from-service-to-tile-cache-does/m-p/625896#M7648</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a situation where we have an offline tile cache used for a basemap for imagery. &amp;nbsp;We also want to be able to use the online streets basemap if connected. &amp;nbsp;This seems straightforward, however, does not work. &amp;nbsp;If I initially load a tiles layer as basemap I am unable to switch the basemap to a basemap that uses service layers and vice-versa.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So if I initially load tiles:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; tileCache &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;TileCache&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;@"D:\Mobile\Imagery\Layers"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
ArcGISTiledLayer imageLayer &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;ArcGISTiledLayer&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;tileCache&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
map &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;Esri&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ArcGISRuntime&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Mapping&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Map&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;Basemap&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;imageLayer&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt; InitialViewpoint &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;Viewpoint&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;extent&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The offline cache loads correctly. &amp;nbsp;However, when I try to switch the reference to a service based basemap&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;RuntimeControls&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;MapView&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Map&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Basemap &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; Basemap&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;CreateStreets&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The base map simply disappears (in the above RuntimeControls is used to share the MapView across the application.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If instead of the first code block I start with:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;map &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;Esri&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ArcGISRuntime&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Mapping&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Map&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;Basemap&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;CreateImageryWithLabelsVector&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt; InitialViewpoint &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;Viewpoint&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;extent&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Switching basemaps in the second block works fine. &amp;nbsp;The opposite behavior is also observed. &amp;nbsp;If I initially start with a Streets layer for basemap, I am unable to switch the basemap to the&amp;nbsp;TileCache. &amp;nbsp;However, when I switch back to the TileCache after the failed attempt to change to streets the basemap is displayed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The only thing that works is to create a new Map instance. &amp;nbsp;The problem with this is the OperationalLayers are lost. &amp;nbsp;I tried a workaround to see if I can recreate the map. &amp;nbsp;Along these lines&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;RuntimeControls&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;MapView&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Map&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Basemap &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; Basemap&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;CreateStreets&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

LayerCollection operationalLayers &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; RuntimeControls&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;MapView&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Map&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;OperationalLayers&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
Envelope extent &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; RuntimeControls&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;MapView&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;VisibleArea&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Extent&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
RuntimeControls&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;MapView&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Map &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;null&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

Map map &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;Map&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;Basemap&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;CreateStreets&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt; InitialViewpoint &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;Viewpoint&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;extent&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;foreach&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; layer &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; operationalLayers&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;OfType&lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt;FeatureLayer&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;FeatureLayer featureLayer &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;FeatureLayer&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;layer&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;FeatureTable&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;map&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;OperationalLayers&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;Add&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;featureLayer&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;‍‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This, though, throws an exception:&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;Esri.ArcGISRuntime.ArcGISRuntimeException was unhandled&lt;BR /&gt; ErrorCode=24&lt;BR /&gt; HResult=-2146233088&lt;BR /&gt; Message=Object already owned.: Already owned.&lt;BR /&gt; Source=Esri.ArcGISRuntime&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;I put the line setting the map to null in there hoping it would release the layer ownership, I even tried to force a garbage collection to see if that would release it, but no luck.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any thoughts? &amp;nbsp;This is a pretty critical aspect to our application users need to be able to see a streets map when they are connected&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;-Joe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 02:40:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/changing-basemap-from-service-to-tile-cache-does/m-p/625896#M7648</guid>
      <dc:creator>JoeHershman</dc:creator>
      <dc:date>2021-12-12T02:40:27Z</dc:date>
    </item>
    <item>
      <title>Re: Changing basemap from service to tile cache does not work</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/changing-basemap-from-service-to-tile-cache-does/m-p/625897#M7649</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Joe,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Basemap switching can be a struggle. I notice two things here.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) If the spatial references of the offline TileCache and the online basemap are not the same you won't be able to switch between them using the same map - I think this might be what you're seeing (can you confirm?). Once &lt;STRONG&gt;Map.SpatialReference&lt;/STRONG&gt; is established you can't change it and most basemap tiles cannot be reprojected on the fly. To fix this you either need to find offline and online basemaps with the same spatial reference or swap out the map as you suggest.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) Regarding the operational layer cloning,&amp;nbsp;a layer can only be owned by one collection. So you need to remove the layer from the original map's layer collection before adding it to the new one. I'm not sure why setting 'Map = null' and forcing GC didn't work, but you should be able to call &lt;STRONG&gt;Map.OperationalLayers.Clear() &lt;/STRONG&gt;to clear out the original map's layer collection which should free up the layers so they can be added to the new map.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope that helps, let&amp;nbsp;us know if it works.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Jul 2017 14:50:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/changing-basemap-from-service-to-tile-cache-does/m-p/625897#M7649</guid>
      <dc:creator>GregDeStigter</dc:creator>
      <dc:date>2017-07-04T14:50:23Z</dc:date>
    </item>
    <item>
      <title>Re: Changing basemap from service to tile cache does not work</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/changing-basemap-from-service-to-tile-cache-does/m-p/625898#M7650</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The former would seem to be the issue. &amp;nbsp;The tile cache is projected into the local reference system used by the company. &amp;nbsp;This is purchased product will have to look into if we can get a copy in 3857. &amp;nbsp;The latter is turned out to be a little more complicated than it would seem. &amp;nbsp;I cannot just set another variable to Map.OperationalLayers because this is just a pointer to the same LayerCollection so calling :Clear clears out the other variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I ended up this this, which does seem to be working:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;private&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;void&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;ResetMapProperties&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;Map map&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;LayerCollection operationalLayers &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;LayerCollection&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Layer&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; tempLayers &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;Layer&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;RuntimeControls&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;MapView&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Map&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;OperationalLayers&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Count&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;RuntimeControls&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;MapView&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Map&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;OperationalLayers&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;CopyTo&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;tempLayers&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN class="keyword token"&gt;foreach&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; operationalLayer &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; tempLayers&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;RuntimeControls&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;MapView&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Map&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;OperationalLayers&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;Remove&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;operationalLayer&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;operationalLayers&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;Add&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;operationalLayer&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;RuntimeControls&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;MapView&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Map&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;OperationalLayers&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;Clear&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;//just in case&lt;/SPAN&gt;

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Envelope extent &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; RuntimeControls&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;MapView&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;VisibleArea&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Extent&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;map&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;InitialViewpoint &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;Viewpoint&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;extent&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;map&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;OperationalLayers &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; operationalLayers&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is giving the TOC control in the toolkit some fits and throws an unhandled exceptions in&amp;nbsp;ObservableLayerContentList trying to refresh the list but for now that is a problem for another day.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the help&lt;/P&gt;&lt;P&gt;-joe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 02:40:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/changing-basemap-from-service-to-tile-cache-does/m-p/625898#M7650</guid>
      <dc:creator>JoeHershman</dc:creator>
      <dc:date>2021-12-12T02:40:30Z</dc:date>
    </item>
    <item>
      <title>Re: Changing basemap from service to tile cache does not work</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/changing-basemap-from-service-to-tile-cache-does/m-p/625899#M7651</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I had the identical error when migrating an app from 10.2.5 to the 100.2 SDK.&amp;nbsp; Apparently a layer already owned by the operationalLayers of an AGSMap cannot be added to the operationalLayers of another AGSMap, and MMPKs provide layers only within a loaded AGSMap.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I previously used two .geodatabase files, one for stable offline basemap data that is never synced, and another with more volatile operational layers that can be synced by many users at any time.&amp;nbsp;&amp;nbsp;I encountered this error after migrating my offline basemap data to be loaded from a mobile map package.&amp;nbsp; I resolved the error by making my own array variable holding the layers and then clearing them from the AGSMobileMapPackage.maps[0].operationalLayers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have requested that the SDK docs be updated to mention restrictions on access to layers owned by another AGSMap.&amp;nbsp; As an aside, I ran into this working with the iOS SDK, not the .Net SDK.&amp;nbsp; I suspect this will be common across platforms.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this helps anyone else with this problem.&lt;/P&gt;&lt;P&gt;-Reed&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Jan 2018 16:05:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/changing-basemap-from-service-to-tile-cache-does/m-p/625899#M7651</guid>
      <dc:creator>ReedHunter</dc:creator>
      <dc:date>2018-01-03T16:05:18Z</dc:date>
    </item>
    <item>
      <title>Re: Changing basemap from service to tile cache does not work</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/changing-basemap-from-service-to-tile-cache-does/m-p/625900#M7652</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I find the solution I documented above to be a lot of code for something I think should be pretty simple.&amp;nbsp; It is also unstable and at times switching basemaps will freeze.&amp;nbsp; The best fix would be to have basemaps in the same projection, but in our case that is not possible. We have purchased tile imagery that is delivered only in the local projection, and would like to also be able to use online basemaps, only available in specific projections&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Jan 2018 15:17:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/changing-basemap-from-service-to-tile-cache-does/m-p/625900#M7652</guid>
      <dc:creator>JoeHershman</dc:creator>
      <dc:date>2018-01-04T15:17:03Z</dc:date>
    </item>
    <item>
      <title>Re: Changing basemap from service to tile cache does not work</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/changing-basemap-from-service-to-tile-cache-does/m-p/625901#M7653</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;gt;&amp;nbsp;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #3d3d3d; font-family: arial,helvetica,'helvetica neue',verdana,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;I'm not sure why setting 'Map = null' and forcing GC didn't work&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Setting the map to null, doesn't mean the layer isn't still associated with that map any longer. It just means you removed one reference to the map instance. You'd have to move the layer out of the old map, before inserting it into a new map.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Jan 2018 17:23:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/changing-basemap-from-service-to-tile-cache-does/m-p/625901#M7653</guid>
      <dc:creator>dotMorten_esri</dc:creator>
      <dc:date>2018-01-04T17:23:16Z</dc:date>
    </item>
    <item>
      <title>Re: Changing basemap from service to tile cache does not work</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/changing-basemap-from-service-to-tile-cache-does/m-p/625902#M7654</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;gt;&amp;nbsp;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #3d3d3d; font-family: arial,helvetica,'helvetica neue',verdana,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;This is giving the TOC control in the toolkit some fits and throws an unhandled exceptions in&amp;nbsp;ObservableLayerContentList trying to refresh the list but for now that is a problem for another day.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When you get to that other day, please log this issue in the GitHub repo &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/laugh.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/Esri/arcgis-toolkit-dotnet/issues/new"&gt;https://github.com/Esri/arcgis-toolkit-dotnet/issues/new&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Jan 2018 17:24:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/changing-basemap-from-service-to-tile-cache-does/m-p/625902#M7654</guid>
      <dc:creator>dotMorten_esri</dc:creator>
      <dc:date>2018-01-04T17:24:21Z</dc:date>
    </item>
    <item>
      <title>Re: Changing basemap from service to tile cache does not work</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/changing-basemap-from-service-to-tile-cache-does/m-p/625903#M7655</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;gt;&amp;nbsp;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #3d3d3d; font-family: arial,helvetica,'helvetica neue',verdana,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;It is also unstable and at times switching basemaps will freeze.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you share a little app that reproduces this, so we can address it or at least provide you with a workaround?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Jan 2018 17:26:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/changing-basemap-from-service-to-tile-cache-does/m-p/625903#M7655</guid>
      <dc:creator>dotMorten_esri</dc:creator>
      <dc:date>2018-01-04T17:26:03Z</dc:date>
    </item>
  </channel>
</rss>

