在谷歌地图Android的V2集群标记 [英] Cluster markers in Google Maps Android v2

查看:487
本文介绍了在谷歌地图Android的V2集群标记的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我把不同的标记从谷歌地图Android的API V2一个GoogleMap的。的问题是,多个标志都设置为相同的位置(纬度/经度),所以用户只能看到最新的标志物。

I have to place different markers on a GoogleMap from the Google Maps Android v2 API. The problem is that multiple markers are set to the same position (lat/lng), so the user only sees the "newest" marker.

有没有可能(在最好的情况:一个库)?是聚类来自同一地区的不同的标记(相对于缩放级别)

Is there a possibility (in the best case: a library) that clusters different markers from the same area (in relation to the zoomlevel)?

我已经阅读有关的 MarkerClusterer 的,但是这是专为JavaScript API的。

I've already read about the MarkerClusterer, but this is designed for the JavaScript API.

推荐答案

谷歌提供了一个工具来做到这一点作为他们的谷歌地图Android的API工具库的一部分:

Google has provided a utility to do this as part of their Google Maps Android API Utility Library:

<一个href="https://developers.google.com/maps/documentation/android/utility/marker-clustering">https://developers.google.com/maps/documentation/android/utility/marker-clustering

与源为:

<一个href="https://github.com/googlemaps/android-maps-utils">https://github.com/googlemaps/android-maps-utils

这篇关于在谷歌地图Android的V2集群标记的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆