MarkerOptions markerOptions = new MarkerOptions().position(position)
.draggable(true);
@Override
public boolean onMarkerClick(Marker marker) {
// TODO Auto-generated method stub
Log.i("GoogleMapActivity", "onMarkerClick");
Toast.makeText(getApplicationContext(),
"Marker Clicked: " + marker.getTitle(), Toast.LENGTH_LONG)
.show();
return false;
}
@Override
public void onMarkerDrag(Marker arg0) {
// TODO Auto-generated method stub
}
@Override
public void onMarkerDragEnd(Marker marker) {
// TODO Auto-generated method stub
double lat = marker.getPosition().latitude;
double lng = marker.getPosition().longitude;
Toast.makeText(
getApplicationContext(),
"Marker " + marker.getTitle() + " dragged from " + fromPosition
+ " to " + lat + lng, Toast.LENGTH_LONG).show();
}
@Override
public void onMarkerDragStart(Marker marker) {
// TODO Auto-generated method stub
fromPosition = marker.getPosition();
Log.e(getClass().getSimpleName(), "Drag start at: " + fromPosition);
}
在此代碼的工作完成了,但我想設置引腳圖中心和拖動地圖,然後設置lat和長我想用我在谷歌地圖上的位置的android
實際上你的問題是什麼? –
我想設置在商業應用程序的設置在谷歌地圖的位置。 –