angular-cesium
angular-cesium copied to clipboard
view.destroy is not a function
Intended outcome:
routing away from a component with
Actual outcome:
routing away from a component with
How to reproduce the issue:
using angular router, route to another component what doesn't have
That is because the error is this :
TypeError: viewer.destory is not a function
so must be a typo somewhere in the code
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.
I encountered a similar crash. After upgrading to the latest version (0.0.71) it was fixed.
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