禁用MyLocation中央按钮在谷歌地图API V2按钮、中央、地图、MyLocation

由网友(长安归故里)分享简介:我搜索了很多在网络上,但我还没有发现任何这回答我的问题。当启用MyLocation与I searched a lot on the web, but I haven't found anything which answered my question.When I enable MyLocation with...

我搜索了很多在网络上,但我还没有发现任何这回答我的问题。 当启用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());
}
阅读全文

相关推荐

最新文章