禁用MyLocation中央按钮在谷歌地图API V2 [英] Disable center button in MyLocation at Google Map API V2

查看:571
本文介绍了禁用MyLocation中央按钮在谷歌地图API V2的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我搜索了很多在网络上,但我还没有发现任何这回答我的问题。 当启用MyLocation与

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

gmap.setMyLocationEnabled(真)

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!

推荐答案

这是非常简单的答案;

It's very simple answer ;

gmap.setMyLocationEnabled(true); ==> means "to center the map on my current location"
gmap.setMyLocationEnabled(false); ==> means "NOT to center the map on my current location"

[更新]

[update]

如果您想删除您的位置按钮在你的地图,搜索这低于在code和删除;

If you want to remove your Location Button on your map, search this below in your code and delete it;

public void setMyLocationButtonEnabled(View v) {
    if (!checkReady()) {
        return;
    }
    // Enables/disables the my location button (this DOES NOT enable/disable the my location
    // dot/chevron on the map). The my location button will never appear if the my location
    // layer is not enabled.
    mUiSettings.setMyLocationButtonEnabled(((CheckBox) v).isChecked());
}

public void setMyLocationLayerEnabled(View v) {
    if (!checkReady()) {
        return;
    }
    // Enables/disables the my location layer (i.e., the dot/chevron on the map). If enabled, it
    // will also cause the my location button to show (if it is enabled); if disabled, the my
    // location button will never show.
    mMap.setMyLocationEnabled(((CheckBox) v).isChecked());
}

这篇关于禁用MyLocation中央按钮在谷歌地图API V2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆