我在地图上有一个标记 humanMarker。当用户移动时如何让它移动?
private Marker humanMarker;
humanMarker = map.addMarker(new MarkerOptions()
.position(new LatLng(mLocation.getLatitude(), mLocation.getLongitude()))
.icon(BitmapDescriptorFactory.fromResource(R.drawable.human)));
尝试覆盖该onLocationChanged
方法。humanMarker
当用户的位置改变时会移动。
@Override
public void onLocationChanged(Location location) {
// Update current location of the marker
humanMarker.setPosition(new LatLng(location.getLatitude(), location.getLongitude()));
}
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句