谷歌地图删除标记路线上下文菜单 [英] Google Maps remove marker route context menu

查看:51
本文介绍了谷歌地图删除标记路线上下文菜单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 Android Studio 的 Google Maps 模板开始了一个新项目,并在地图上添加了一个标记.

I started a new project with the Google Maps template of Android Studio and just added a marker to the map.

LatLng location = new LatLng(lat, lng);
Marker marker = mMap.addMarker(new MarkerOptions()
            .position(location)
            .icon(BitmapDescriptorFactory.fromResource(R.drawable.marker)));

当我点击标记时,右下角会出现一个带有 Google 地图图标的小菜单:

When I click the Marker there comes a little menu with a Google Maps icon on the bottom right corner:

我怎样才能摆脱这个东西?我找不到任何我什至不知道如何称呼它的东西,但我真的需要摆脱它.

How can I get rid of this thing? I couldn't find anything I even don't know how to call it but I really need to get rid of it.

推荐答案

您需要致电 setMapToolbarEnabled UiSettings 方法

You need to call setMapToolbarEnabled method of UiSettings

像这样:

@Override
public void onMapReady(GoogleMap googleMap) {
    googleMap.getUiSettings().setMapToolbarEnabled(false);

    // Do other staff
}

这篇关于谷歌地图删除标记路线上下文菜单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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