Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

212
Views
HERE Maps JavaScript API: how to get info from click on cluster marker

Following these 2 docs:

https://developer.here.com/documentation/examples/maps-js/clustering/custom-cluster-theme

https://developer.here.com/documentation/maps/3.1.30.3/dev_guide/topics/clustering.html

I have a cluster of markers. But the target data from clicking on the cluster marker is different from that from clicking on the noise marker.

  1. How can I get data from the cluster and noise markers on click to show in a bubble without overriding the theme? How do I distinguish which one was clicked: cluster or noise? Because if I simply do this:
clusteredDataProvider.addEventListener('tap', function(event) {
  let data = event.target.getData();
  console.log(data)
});

the data I need will be in data.c.a.data from cluster and in data.a.data from noise.

  1. How do I stop the ridiculous zoom-in and zoom-out effect when clicking on a cluster marker? Because if the map is set to zoom 2 and the noise markers are on zoom 16, when you click on the cluster marker it starts zooming all the way from 2 to 16 and then straight back to 2 without even a chance of loading the maps. This is awful. How can I stop it?

Thank you.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

  1. The only way which works so far is only with overriding the theme and getting a random point on clicking the cluster, the random point data is the same object as the noise data. Can't figure out how to do that without that.

  2. To stop that insane zoom in and out on clicking markers, I've added:

let zoom = map.getZoom();

map.setCenter(position, zoom > 6 ? true : false);

if (zoom < 7) {
    map.setZoom(7, true);
}

It's the animated centering followed by animated zooming which does that. So I'm centering the map without animation at the lowest zoom and then animate zoom in. I animate centering only when the zoom is at below the cluster marker level.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!