@googlemaps/markerclusterer:如何设置 maxZoom?

Ale*_*tov 4 javascript google-maps-markers markerclusterer

我试图弄清楚如何设置 maxZoom 属性。

我找到了可接受的参数列表:

new MarkerClusterer({ map, markers, algorithm, renderer, onClusterClick })
Run Code Online (Sandbox Code Playgroud)

所以,我不想实现我自己的算法。我觉得默认的那个很酷。

我maxZoom在文档中找到了该属性。但无法理解如何将其传递给 MarkerClusterer 对象。

我看到了这个问题,但看起来 MarkerClusterer 实现已经改变,答案已经过时了。MarkerClusterer 对象目前仅接受一个具有上述字段的参数。

我将非常感谢任何帮助。

Ale*_*tov 5

感谢@mrupsidown 的帮助!设置custom的正确方法maxZoom是改变算法:

const algorithm = new SuperClusterAlgorithm({ maxZoom: 12 })
new MarkerClusterer({map, markers, algorithm, renderer, onClusterClick});
Run Code Online (Sandbox Code Playgroud)