There is an issue with detecting when the map has rendered the markers.
I have added a listener to the 'render' event:
mapEngine.addEventListener('render', onRenderChange)
and wait for the event to return the map engine to know when the rendering is done as I have seen as an answer for a similar question here.
function onRenderChange(evt) {
if (map.getEngine() === evt.target) {
//render is done
}
}
The result is that the listener returns the map engine multiple times (about 40-45 times for the render of 200 markers and the number of times seems random with every refresh).
Furthermore, sometimes the map pauses the rendering for some time (1-2s) and then continues. This happens when rendering changes in existing markers (such as change a marker's position).
What is an accurate way of knowing when the map is done rendering?
I use the HERE maps API for JavaScript v3.0 in an angular project.
The icon is a single global SVG icon reused for all the markers. I have also tried with a PNG icon with the same results.
A group 'markersGroup' is added to the map when the map is initialized. The markers are being added to the map in bulk using:
markersGroup.addObjects(markersToAdd);
where markersToAdd is an array of markers (H.map.Marker).
Map JavaScript API 3.0 is deprecated. I would recommend using 3.1.
Typically, the map is rendered one time while adding a grouped objects. The 40-45 times for the render of a group of 200 markers looks unusual. Not sure if it is caused by Angular. Could you try JavaScript API 3.1? if the issue remains, please share the snippet codes.