Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

215
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda