Change position of Google Maps API’s “My location” button

By | July 1, 2019


I am using the Google Maps Android API v2, and I need a way to chance the position of the “My Location” button.

I get the “My Location” button like this:

final GoogleMap map = ((SupportMapFragment) getSupportFragmentManager()

// This gets the button


Just use GoogleMap.setPadding(left, top, right, bottom), which allows you to indicate parts of the map that may be obscured by other views. Setting padding re-positions the standard map controls, and camera updates will use the padded region.

Rate this post

Leave a Reply

Your email address will not be published. Required fields are marked *