如何隐藏];导航"和" GPS指针"按钮,当我点击了Android谷歌地图上的标记

问题描述:

当我点击谷歌地图上的标记,导航和全球定位系统指针按钮来我out.How可以隐藏这些两个按钮编程在Android开发?

When I click the marker on the google map, "Navigation" and "GPS Pointer" buttons come out.How can I hide those two buttons programatically in android development?

有关你已经用红色标出的工具栏,可以使用禁用的setMapToolbarEnabled()法UISettings 。

For the toolbar you have outlined in red, you can disable it using the setMapToolbarEnabled() method in UISettings.

从文档:

设定了preference的地图工具条是否启用或   禁用。如果启用,用户将看到一个酒吧,各种   上下文相关的行动,其中包括打开此图中的谷歌地图   应用程序和寻找方向的突出标志,在谷歌地图   应用程序。

Sets the preference for whether the Map Toolbar should be enabled or disabled. If enabled, users will see a bar with various context-dependent actions, including 'open this map in the Google Maps app' and 'find directions to the highlighted marker in the Google Maps app'.

code为例,禁用两个按钮:

Code example to disable the two buttons:

//Disable Map Toolbar:
mMap.getUiSettings().setMapToolbarEnabled(false);

以防万一,你也想知道变焦按钮,您可以禁用它们是这样的:

Just in case you were also wondering about the zoom buttons, you can disable them like this:

mMap.getUiSettings().setZoomControlsEnabled(false);