Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
346 views
in Technique[技术] by (71.8m points)

android - Disable center button in MyLocation at Google Map API V2

I searched a lot on the web, but I haven't found anything which answered my question. When I enable MyLocation with

gmap.setMyLocationEnabled(true)

I automatically get a button to center the map on my current location. I want to remove it and so I'm asking you how to do this. I hope somebody of you can help me!

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

After calling the following methods on your GoogleMap object:

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

you should see the current location indicator (the blue circle), but no control to center the map on that location.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...