Google map Marker cluster 谷歌地图图标聚合
文章目录
===
Have you wonder how do some map app provide functions to cluster icons/markers?
Here is one solution:
Inside the code:
MarkerCluster obj
hide all markers first, calculate the markers distance, cluster them together in pixel distance and then show the clustericon
add markers
resetviewport
redraw
createClusters_
addToClosestCluster_
distanceBetweenPoints_
if two markers are closer than 40000, cluster them together
new Cluster
Cluster obj
ClusterIcon obj, extended from overlayview
评论
登录后参与技术讨论,分享你的经验与见解。
登录 / 注册暂无评论