0

We have upgraded the project Angular version 7 to angular version 10, but on Here Map API not working on below

  1. The first Angular component is working fine
  2. When we change or select another component Here map is not rendering getting below error
ERROR Error: Uncaught (in promise): TypeError: Cannot read property 'immediateRedraw' of null
TypeError: Cannot read property 'immediateRedraw' of null
at mapsjs-core.js:418
at l.invoke (polyfills.572d73b94f023dc97cfc.js:1)

How to fix the Here Map issue?

Nimantha
  • 6,405
  • 6
  • 28
  • 69
Nitin Karande
  • 1,280
  • 14
  • 33

1 Answers1

0

This error is usually due to the map div not rendered correctly.

Nimantha
  • 6,405
  • 6
  • 28
  • 69
  • We've the same situation with angular and here-maps api. The map is rendered normally in the container-div. We're working with the map: adding markers, zooming, etc. and if we leave the current component by navigating to another route (component). We call the dispose-methods: ``` this.mapBehavior?.dispose(); this.mapEvents?.dispose(); this.map?.dispose(); this.mapBehavior = null; this.mapEvents = null; this.map = null; ``` Right after the call to map.dispose() the Error is thrown. If we comment out the line map.dispose() the error isn't thrown. map is H:map – carstinho Feb 11 '22 at 06:29