0

I am Using Bingmaps angular-maps(Xmap) in my project and i am using clustering layer as in below Screenshot. Clustering layer on Bingmaps

And on Click of a cluster the parent cluster in getting clustered again into smaller Clusters like below screenshot.

enter image description here

But what i want to achieve is when a user clicks on particular cluster, I want to avoid the further clustering of my Pushpins, instead i want to show all my pushpins under that cluster. Please help !!

I am using Angular-maps(xmap) Bingmap.

Stackblitz link for the infusioncode Bing-maps with clustering layer is as below.

stackblitz

4

1 回答 1

0

看起来图钉太近了,网格尺寸太大而无法自动处理。

我有类似的问题,我的第一个想法是删除整个聚类层,但是在删除它之后,包含的 puspins 也被删除了

我通过在某个缩放级别上更改网格大小找到了一个解决方案,并且就像一个魅力

let lastZoomLevel = map.current.getZoom();
const handleChangeZoom = e => {
  if (lastZoomLevel !== map.current.getZoom()) {
    lastZoomLevel = map.current.getZoom();
  
    if (map.getZoom() >= 12) {
      map.layers[0].setOptions({ gridSize: 1 });
    } else {
      map.layers[0].setOptions({ gridSize: 80 });
    }
  }
}

window.Microsoft.Maps.Events.addHandler(map.current, 'viewchangeend', handleChangeZoom);
于 2020-08-11T23:22:51.913 回答