如何將對象添加到新的谷歌地圖Android API v2中的標記? 所以,如果我們點擊InfoWindow
,我們可以用對象做些什麼?Android Google Maps v2 - 將對象添加到標記
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));
}
這設置對象的位置,標題和片段。但我希望能夠去關於這個特定的Spot對象的另一個活動,如果我點擊InfoWindow
您可以使用[android-maps-extensions](https://code.google.com/p/android-maps-extensions)擴展Marker和Polygon類,並允許您設置並從中獲取對象 – primax79