作者热门文章
- mongodb - 在 MongoDB mapreduce 中,如何展平值对象?
- javascript - 对象传播与 Object.assign
- html - 输入类型 ="submit"Vs 按钮标签它们可以互换吗?
- sql - 使用 MongoDB 而不是 MS SQL Server 的优缺点
当我点击谷歌地图上的标记时,会出现“导航”和“GPS 指针”按钮。如何在 Android 开发中以编程方式隐藏这两个导航按钮?
最佳答案
对于您用红色勾勒的按钮组,您可以使用 setMapToolbarEnabled() method in UISettings 禁用它。 .
来自文档:
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'.
使用 Java 禁用两个按钮的代码示例:
//Disable Map Toolbar:
mMap.getUiSettings().setMapToolbarEnabled(false);
如果您还想知道缩放按钮,您可以使用 Java 像这样禁用它们:
mMap.getUiSettings().setZoomControlsEnabled(false);
在 Kotlin 中,您可以使用属性访问语法:
mMap.uiSettings.isMapToolbarEnabled = false
mMap.uiSettings.isZoomControlsEnabled = false
关于android - 当我单击 android 谷歌地图上的标记时如何隐藏 "Navigation"和 "GPS Pointer"按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30430664/
leaflet:一个开源并且对移动端友好的交互式地图 JavaScript 库 中文文档: https://leafletjs.cn/reference.html 官网(英文): ht
我是一名优秀的程序员,十分优秀!