I searched a lot on the web, but I haven\'t found anything which answered my question. When I enable MyLocation with
gmap.setMyLocationEnabled(true)<
It's very simple answer ;
gmap.setMyLocationEnabled(true); ==> means "to center the map on my current location"
gmap.setMyLocationEnabled(false); ==> means "NOT to center the map on my current location"
[update]
If you want to remove your Location Button on your map, search this below in your code and delete it;
public void setMyLocationButtonEnabled(View v) {
if (!checkReady()) {
return;
}
// Enables/disables the my location button (this DOES NOT enable/disable the my location
// dot/chevron on the map). The my location button will never appear if the my location
// layer is not enabled.
mUiSettings.setMyLocationButtonEnabled(((CheckBox) v).isChecked());
}
public void setMyLocationLayerEnabled(View v) {
if (!checkReady()) {
return;
}
// Enables/disables the my location layer (i.e., the dot/chevron on the map). If enabled, it
// will also cause the my location button to show (if it is enabled); if disabled, the my
// location button will never show.
mMap.setMyLocationEnabled(((CheckBox) v).isChecked());
}
After calling the following methods on your GoogleMap object:
map.setMyLocationEnabled(true);
map.getUiSettings().setMyLocationButtonEnabled(false);
you should see the current location indicator (the blue circle), but no control to center the map on that location.
Have you tried something like this?
<fragment xmlns:map="http://schemas.android.com/apk/res-auto"
android:id="@+id/backgroundMap"
android:layout_width="match_parent"
android:layout_height="match_parent"
map:uiZoomControls="false"
map:uiCompass="false"
class="com.google.android.gms.maps.SupportMapFragment"/>
It effectively removes all the default UI off my maps except for the UI related to markers. Check this link for more info.
EDIT
Replying to OP's comment, id advise using a custom location algorithm instead of letting the google maps API take over. I've done it before and its not overly painful, i just put a marker on the map to let the user know where he is, and make the marker draggable so the user can refine his position manually.
Check this link.