When my map shows, it always start at a fixed location (near Africa).
Then, I use the following code to center the map to the location I want.
mMap.a
Just in case you want to load Google Map
at any initial Location
programmatically then you can use this piece of code,
FragmentManager fm = getFragmentManager(); // getChildFragmentManager inside fragments.
CameraPosition cp = new CameraPosition.Builder()
.target(initialLatLng) // your initial co-ordinates here. like, LatLng initialLatLng
.zoom(zoom_level)
.build();
SupportMapFragment mapFragment = SupportMapFragment.newInstance(new GoogleMapOptions().camera(cp));
fm.beginTransaction().replace(R.id.rl_map, mapFragment).commit();
Add this piece of code for layout
This will load GoogleMap
at particular Location
directly i.e, initialLatLng.