I have the following code to create and load a GraphicsLayerView. When the user navigates away from the tab while the map is rendering, which triggers ngOnDestroy() to destroy the mapView, it receives the cancelled:layerview-create error. Can this error be safely ignored or there's a better way to handle it? Thanks.
const func = () {
const subject$ = new Subject<void>();
this.layer = this.service.createGraphicsLayer().layer;
this.service.loadGraphicsLayer(this.map, this.layer).subscribe(() => {
this.mapView.whenLayerView(this.layer).then((lv: __esri.GraphicsLayerView) => {
this.layerView = lv;
subject$.next(void 0);
subject$.complete();
})
// .catch(error => {
// if (error.name !== 'cancelled:layerview-create') {
// throw error;
// }
// });
});
return subject$;
}
Logging exception stacktrace for full details:
- _s {name: 'cancelled:layerview-create', details: {…}, message: 'layerview creation cancelled'}
- details: {layer: p7}
- message: "layerview creation cancelled"
- name: "cancelled:layerview-create"
[[Prototype]]: e4