3

Well i have a map and i need to show the Location Button so i try this way:

 mMap.setMyLocationEnabled(true);

And it works without any trouble, but in the ButtonListener i call a method to put a Marker on the actual location like this:

 mMap.setOnMyLocationButtonClickListener(new GoogleMap.OnMyLocationButtonClickListener() {
        @Override
        public boolean onMyLocationButtonClick() {
            setMarker();
            return true;
        }
    });

I set the return true to disable the excecution of the super method but it still shows me the marker and the native location:

enter image description here

How can i only show the marker without hiding the Location Button?, i try this but it doesn't work.

mMap.setMyLocationEnabled(false);
    mMap.getUiSettings().setMyLocationButtonEnabled(true);

Thank you very much!

Daniel Nugent
  • 43,104
  • 15
  • 109
  • 137
Adan_SL
  • 348
  • 1
  • 5
  • 16
  • 1
    Looks like it's not possible to use the standard "My Location" button and disable the default blue dot and circle, see here: http://stackoverflow.com/questions/26110788/remove-default-users-location-icon – Daniel Nugent Mar 19 '16 at 21:44
  • 1
    I don't think I ever tried it but this person claims to have a solution: http://stackoverflow.com/a/31636469/3307720 – nasch Mar 20 '16 at 00:41
  • @nasch i try to do that way and doesn't work, it's not possible to do like i want to do, thanks anyway – Adan_SL Mar 22 '16 at 14:00
  • @DanielNugent It's true Daniel, it's not possible, thank you very much! – Adan_SL Mar 22 '16 at 14:01

0 Answers0