Android - Disable MyLocation button on google map [duplicate]
Asked Answered
P

1

15

I am using latest Google Maps API. My problem goes like this:

I want to remove the MyLocation button (The blue dot/arrow) WITHOUT disabling MyLocation layer.

if I use this code:

googleMap.getUiSettings().setMyLocationButtonEnabled(false);

It doesn't work, unless I add:

googleMap().setMyLocationEnabled(false);

but I want to keep it true. any suggestions?

Poppo answered 28/12, 2013 at 12:19 Comment(2)
did you see this(see john ellis answer) #14376861Dillie
Do you want to show your own custom marker?Ashbey
S
12

Google Map Doc says You can disable the button from appearing altogether by calling

UiSettings.setMyLocationButtonEnabled(boolean true/false)

Sweetmeat answered 28/12, 2013 at 12:33 Comment(7)
This does not work for me I still get the blue button.Levo
you can ask new question with your your code.above method valid method by google , you are doing something wrong in your code.Sweetmeat
If I ask a new question the SO crowd will probably mark it as a duplicate.Levo
Shows error: "non-static method setMyLocationButtonEnabled(boolean) cannot be referenced from a static context"Nies
To avoid the last error of "non-static method" just do: mMap.getUiSettings().setMyLocationButtonEnabled(true/false)Feud
Is there any way to attach a custom listener to it?Nicolanicolai
@Nicolanicolai What's your actual requirement ?Sweetmeat

© 2022 - 2024 — McMap. All rights reserved.