Is there any way to disable the Marker Clusterer for less than defined marker counts?

℡╲_俬逩灬. 提交于 2019-12-23 01:29:12

问题


I want my Marker Clusterer; not to cluster markers less than 4 or something. It is clustering all the markers even for 2 markers.

Is there any possible way to set it?


回答1:


The option you want is not available with MarkerClusterer, but it is an option if you use an an enhancement named: MarkerClustererPlus. It is essentially a Google Maps v3 upgrade of the original v2 MarkerClusterer, which was then further enhanced and extended by Gary Little. It functions pretty much the same as the original MarkerClusterer, but offers more options.

Specific to your question, you may pass a set of options to the MarkerClusterer constructor function (when using MarkerClustererPlus) and include an option: minimumClusterSize. That will give you what you want.



来源:https://stackoverflow.com/questions/10266725/is-there-any-way-to-disable-the-marker-clusterer-for-less-than-defined-marker-co

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!