TheKeithStewart / angular-esri-components

A set of Angular components to work with ArcGIS API for JavaScript v4.6
Apache License 2.0
43 stars 28 forks source link

Removing layers error #10

Closed plattdl closed 7 years ago

plattdl commented 7 years ago

Hi,

I am trying to remove a feature layer I added to the map by calling the removeAll() method.

The layer gets removed but the following appears in the console and the app becomes unstable, especially the map component.

error_handler.js:60 TypeError: this.controller.destroy is not a function
    at Object.d.detach (http://js.arcgis.com/4.2/esri/views/MapView.js:510:98)
    at Object.update (http://js.arcgis.com/4.2/esri/views/MapView.js:25:72)
    at k._animationFrame (http://js.arcgis.com/4.2/init.js:329:23)

I am guessing this is a change detection issue.

Is there a proper way to remove layers from the map that I am missing? I couldn't find any in the documentation.

Thanks!

TheKeithStewart commented 7 years ago

Thanks for reporting this issue, @plattdl!

It appears that this was an issue specifically with ArcGIS API for JavaScript v4.2. I have updated this library to now use ArcGIS API for JavaScript v4.3 and the issue seems to be corrected.