heremaps / maps-api-for-javascript-examples

Self-contained examples for Maps API for JavaScript v3.
https://developer.here.com/javascript-apis/documentation/v3/maps
Other
194 stars 430 forks source link

Error when dispose map #161

Closed paolosantarsiero closed 3 months ago

paolosantarsiero commented 3 months ago

I received this error when i try to dispose map:

Uncaught TypeError: Cannot read properties of null (reading 'init')
    at WorkerBroker.postMessage (mapsjs-core.js:446:74875)
    at Proxy.value (mapsjs-core.js:452:56586)
    at Proxy.value (mapsjs-core.js:452:55929)
    at mapsjs-core.js:454:73957
    at Proxy.value (mapsjs-core.js:454:74713)
    at Proxy.value (mapsjs-core.js:454:73916)
    at Proxy.value (mapsjs-core.js:454:96920)
    at m.i (mapsjs-core.js:374:330)
    at Zd.u (mapsjs-core.js:89:583)
    at m.i (mapsjs-core.js:413:200)

probably because map is in animation zoom or moviment. Is there a possibile to stop all animation camera and after dispose map?

dbacarel commented 3 months ago

You can try listening for the changeend event on the H.Map instance and only then dispose the map.

paolosantarsiero commented 3 months ago

I Just tried but It Is not working. I'm switching to HARP engine and It works very well.

dbacarel commented 3 months ago

my bad, the event name is mapviewchangeend.