<?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 Cannot remove WMTS layer from MapView in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cannot-remove-wmts-layer-from-mapview/m-p/101198#M9314</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I changed to use ArcGIS JS 4.10 API and noticed that I cannot remove WMTS layer from&amp;nbsp;view.map&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;console.log&amp;nbsp;shows:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;Uncaught (in promise) TypeError: Cannot set property 'visible' of null&lt;BR /&gt; at Object.&amp;lt;anonymous&amp;gt; (MapView.js:603)&lt;BR /&gt; at b.callback (dojo.js:365)&lt;BR /&gt; at b.notify (dojo.js:325)&lt;BR /&gt; at b.propertyInvalidated (dojo.js:326)&lt;BR /&gt; at b.propertyInvalidated (dojo.js:298)&lt;BR /&gt; at b.callback (dojo.js:330)&lt;BR /&gt; at b.notify (dojo.js:325)&lt;BR /&gt; at b.propertyCommitted (dojo.js:327)&lt;BR /&gt; at b.propertyCommitted (dojo.js:299)&lt;BR /&gt; at b.internalSet (dojo.js:297)&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have attached example file. Changing active layer to another will trigger the remove operation which causes the problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This was working on ArcGIS JS&amp;nbsp;API 4.9 and this problem occurs only with WMTS layers. Please provide a fix as soon as possible.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;UPDATE:&lt;/P&gt;&lt;P&gt;Found a workaround. Set layer visible to false on WMTS layer before removing it from the MapView then it does not cause the crash.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Br,&lt;/P&gt;&lt;P&gt;Markus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 18 Dec 2018 11:01:56 GMT</pubDate>
    <dc:creator>MarkusÅfelt</dc:creator>
    <dc:date>2018-12-18T11:01:56Z</dc:date>
    <item>
      <title>Cannot remove WMTS layer from MapView</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cannot-remove-wmts-layer-from-mapview/m-p/101198#M9314</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I changed to use ArcGIS JS 4.10 API and noticed that I cannot remove WMTS layer from&amp;nbsp;view.map&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;console.log&amp;nbsp;shows:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;Uncaught (in promise) TypeError: Cannot set property 'visible' of null&lt;BR /&gt; at Object.&amp;lt;anonymous&amp;gt; (MapView.js:603)&lt;BR /&gt; at b.callback (dojo.js:365)&lt;BR /&gt; at b.notify (dojo.js:325)&lt;BR /&gt; at b.propertyInvalidated (dojo.js:326)&lt;BR /&gt; at b.propertyInvalidated (dojo.js:298)&lt;BR /&gt; at b.callback (dojo.js:330)&lt;BR /&gt; at b.notify (dojo.js:325)&lt;BR /&gt; at b.propertyCommitted (dojo.js:327)&lt;BR /&gt; at b.propertyCommitted (dojo.js:299)&lt;BR /&gt; at b.internalSet (dojo.js:297)&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have attached example file. Changing active layer to another will trigger the remove operation which causes the problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This was working on ArcGIS JS&amp;nbsp;API 4.9 and this problem occurs only with WMTS layers. Please provide a fix as soon as possible.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;UPDATE:&lt;/P&gt;&lt;P&gt;Found a workaround. Set layer visible to false on WMTS layer before removing it from the MapView then it does not cause the crash.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Br,&lt;/P&gt;&lt;P&gt;Markus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Dec 2018 11:01:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cannot-remove-wmts-layer-from-mapview/m-p/101198#M9314</guid>
      <dc:creator>MarkusÅfelt</dc:creator>
      <dc:date>2018-12-18T11:01:56Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot remove WMTS layer from MapView</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cannot-remove-wmts-layer-from-mapview/m-p/101199#M9315</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi there,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for letting us know about this issue. We created an issue for it and it will be fixed in future release.&amp;nbsp;&lt;/P&gt;&lt;P&gt;-Undral&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Dec 2018 16:01:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cannot-remove-wmts-layer-from-mapview/m-p/101199#M9315</guid>
      <dc:creator>UndralBatsukh</dc:creator>
      <dc:date>2018-12-19T16:01:07Z</dc:date>
    </item>
  </channel>
</rss>

