如何允许用户在Google地图上的任意位置放置或拖动自定义标记(例如图片)?
If you want to make your user able to set a custom location in your Map, you can achieve it by doing the following:
OnMapClickListener
interface myMap.setOnMapClickListener(this);
public void onMapClick(LatLng point)
which is the method you have to implement in step 1. Like this:
MarkerOptions options=new MarkerOptions().snippet(getString(R.string.snippet))
.icon(BitmapDescriptorFactory.fromResource(R.drawable.mymarker))
.anchor(0.5f, 0.5f);
options.position(point);
myMap.addMarker(options);
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.