I would like to zoom and position my GoogleMap
such that all markers, including the blue MyLocation
marker, are visible. This SO question shows how to do this for all manually added markers, but I am not sure how to get a handle to the MyLocation
marker, which is automatically added after calling setMyLocationEnabled(true)
, in order to pass it to the LatLngBounds.Builder
.
I have tried using GoogleMap.getMyLocation()
, and I am calling it in onPostCreate
, after the map has been fully initialized. The call returns null
though. This SO answer talks about a bug with getMyLocation()
, but also mentions that it was fixed.