angular-cesium icon indicating copy to clipboard operation
angular-cesium copied to clipboard

view.destroy is not a function

Open gjbohnnon opened this issue 4 years ago • 4 comments

Intended outcome:

routing away from a component with does not cause viewer.destroy() in AcMapComponent to throw and error

Actual outcome: routing away from a component with does not cause viewer.destroy() in AcMapComponent to not throw and error

How to reproduce the issue: using angular router, route to another component what doesn't have Version

gjbohnnon avatar May 03 '21 19:05 gjbohnnon

That is because the error is this :

TypeError: viewer.destory is not a function

so must be a typo somewhere in the code

Crocsx avatar May 08 '21 02:05 Crocsx

Also seeing this issue, wanted to provide more information. When trying to navigate to another component, console shows the following error, and Angular does not complete navigation:

core.js:6210 ERROR Error: Uncaught (in promise): TypeError: viewer.destory is not a function
TypeError: viewer.destory is not a function
    at AcMapComponent.ngOnDestroy (angular-cesium.js:3007)
    at executeOnDestroys (core.js:7405)
    at cleanUpView (core.js:7318)
    at destroyViewTree (core.js:7144)
    at destroyLView (core.js:7296)
    at RootViewRef.destroy (core.js:22601)
    at ComponentRef$1.destroy (core.js:25144)
    at RouterOutlet.deactivate (router.js:5307)
    at ActivateRoutes.deactivateRouteAndOutlet (router.js:2072)
    at ActivateRoutes.deactivateRouteAndItsChildren (router.js:2050)
    at resolvePromise (zone-evergreen.js:1213)
    at resolvePromise (zone-evergreen.js:1167)
    at zone-evergreen.js:1279
    at ZoneDelegate.invokeTask (zone-evergreen.js:406)
    at Object.onInvokeTask (core.js:28540)
    at ZoneDelegate.invokeTask (zone-evergreen.js:405)
    at Zone.runTask (zone-evergreen.js:178)
    at drainMicroTaskQueue (zone-evergreen.js:582)
    at ZoneTask.invokeTask [as invoke] (zone-evergreen.js:491)
    at invokeTask (zone-evergreen.js:1600)

I'm assuming the viewer.destroy function is called as a part of the NgDestroy. But looking into the viewer object, it doesn't grab any of the prototype functions from cesium.Viewer, which includes the .destroy function. I couldn't figure out what to change to have it access the prototype functions, but hopefully this helps find a solution.

I'm using v0.0.67 with Angular v11.2.12.

AFTERWAKE avatar May 18 '21 20:05 AFTERWAKE

I encountered a similar crash. After upgrading to the latest version (0.0.71) it was fixed.

ramtob avatar Jun 01 '21 12:06 ramtob

I encountered a similar crash. After upgrading to the latest version (0.0.71) it was fixed.

Can confirm this fixed it for me as well

AFTERWAKE avatar Jun 02 '21 18:06 AFTERWAKE