drag and drop icons to google map v2 android

牧云@^-^@ 提交于 2019-12-25 01:45:28

问题


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?


回答1:


You are looking for MarkerOptions.draggable(true). Also check GoogleMap.OnMarkerDragListener , if you want to know when user drags your Marker.



来源:https://stackoverflow.com/questions/17512597/drag-and-drop-icons-to-google-map-v2-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!