拖放图标谷歌地图Android版V2
问题描述:
我用在我的Android项目谷歌地图V2。
我知道,它可以添加自定义标记作为一个图标作为显示在以下code:
I'm using Google map v2 in my android project. I know that its possible to add custom markers as an icons as shown in the following code:
MarkerOptions marker= new MarkerOptions()
.position(location)
.icon(BitmapDescriptorFactory.
fromResource(R.drawable.map_marker_cab_pickup));
map.addMarker( marker );
时有任何可能通过拖动来移动该图标拖放到任何位置在地图上?
Is there are any possibility to move this icons by drag and drop to any location on the map?
答
您正在寻找 MarkerOptions.draggable(真)
。同时检查 GoogleMap.OnMarkerDragListener
,如果你想,当用户拖动您的标记就知道了。
You are looking for MarkerOptions.draggable(true)
. Also check GoogleMap.OnMarkerDragListener
, if you want to know when user drags your Marker.