@Override public void onMapReady(final GoogleMap googleMap) { this.googleMap = googleMap; googleMap.setMyLocationEnabled(true); if (callback != null) { callback.onMapReady(googleMap); } if (cameraChangeListener != null) { googleMap.setOnCameraChangeListener(cameraChangeListener); } googleMap.setOnMarkerDragListener( new GoogleMap.OnMarkerDragListener() { @Override public void onMarkerDragStart(Marker arg0) {} @SuppressWarnings("unchecked") @Override public void onMarkerDragEnd(Marker arg0) { googleMap.animateCamera(CameraUpdateFactory.newLatLng(arg0.getPosition())); } @Override public void onMarkerDrag(Marker arg0) {} }); }
public void showMyLocationButton() { if (googleMap != null) { UiSettings uiSettings = googleMap.getUiSettings(); googleMap.setMyLocationEnabled(true); uiSettings.setMyLocationButtonEnabled(true); } }