Cannot remove WMTS layer from MapView

344
1
12-18-2018 03:01 AM
MarkusÅfelt
New Contributor III

Hi,

I changed to use ArcGIS JS 4.10 API and noticed that I cannot remove WMTS layer from view.map

console.log shows:

Uncaught (in promise) TypeError: Cannot set property 'visible' of null
at Object.<anonymous> (MapView.js:603)
at b.callback (dojo.js:365)
at b.notify (dojo.js:325)
at b.propertyInvalidated (dojo.js:326)
at b.propertyInvalidated (dojo.js:298)
at b.callback (dojo.js:330)
at b.notify (dojo.js:325)
at b.propertyCommitted (dojo.js:327)
at b.propertyCommitted (dojo.js:299)
at b.internalSet (dojo.js:297)

I have attached example file. Changing active layer to another will trigger the remove operation which causes the problem.

This was working on ArcGIS JS API 4.9 and this problem occurs only with WMTS layers. Please provide a fix as soon as possible.

UPDATE:

Found a workaround. Set layer visible to false on WMTS layer before removing it from the MapView then it does not cause the crash.

Br,

Markus

Tags (1)
0 Kudos
1 Reply
UndralBatsukh
Esri Regular Contributor

Hi there, 

Thank you for letting us know about this issue. We created an issue for it and it will be fixed in future release. 

-Undral