Reputation: 1447
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.
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.
Thank you.
Upvotes: 0
Views: 648
Reputation: 1447
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.
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.
Upvotes: 0