Google Maps remove marker route context menu

荒凉一梦 提交于 2019-12-09 17:10:02

问题


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)));

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.


回答1:


You need to call setMapToolbarEnabled method of UiSettings

Like this:

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

    // Do other staff
}


来源:https://stackoverflow.com/questions/28377823/google-maps-remove-marker-route-context-menu

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!