17

Directions Buttons

I want to remove those buttons because I want to put the route implementation when I tap a button inside a Bottom sheet widget. My other question is, how Can I use the routes in Google maps inside my App and not redirected to Google maps? Do I need to enable the Routes API?

This is the same question in Android. Android google maps marker disable navigation option

Mavro
  • 169
  • 1
  • 1
  • 7

2 Answers2

24

[google_maps_flutter] Support enable/disable MapToolbar.

Add this line inside your GoogleMap widget to enable or disable MapToolbar.

GoogleMap(

mapToolbarEnabled: false,

)

PS : consumeTapEvents: true, stops recentering the map and marker's InfoWindow.

Samir Dangal
  • 2,591
  • 2
  • 15
  • 17
7

When Creating a Marker set consumeTapEvents to true.

Marker(
    markerId: MarkerId('0'),
    icon: BitmapDescriptor.defaultMarker,
    position: LatLng(51.522522, -0.141198),
    consumeTapEvents: true
);

Tested on google_maps_flutter: 0.5.16 with Flutter v1.7.3

From consumeTapEvents docs

True if the marker icon consumes tap events. If not, the map will perform default tap handling by centering the map on the marker and displaying its info window.

vovahost
  • 34,185
  • 17
  • 113
  • 116