【发布时间】:2012-12-02 18:35:43
【问题描述】:
我们如何在新的 Google Maps Android API v2 中将对象添加到标记?
那么如果我们点击InfoWindow,我们可以对这个对象做点什么吗?
public void addSpotOnMap(Spot spot) {
getMap().addMarker(new MarkerOptions()
.position(new LatLng(spot.getParseGeoPoint().getLatitude(), spot.getParseGeoPoint().getLongitude()))
.title(spot.getName())
.snippet(spot.getCategory())
.draggable(false));
}
这会设置对象的位置、标题和 sn-p。但是如果我点击InfoWindow
【问题讨论】:
-
你可以使用android-maps-extensions 它扩展了 Marker 和 Polygon 类,并允许你从中设置和获取对象
标签: android google-maps-markers google-maps-android-api-2