Repository: flutter
Issue: Programmatically Selecting a Marker to Navigate To Location Google_Maps_Flutter
Labels: c: new feature,p: maps,package,c: proposal,team-ecosystem,P3,triaged-ecosystem

This is a [copy paste of my Stack Overflow question -](https://stackoverflow.com/questions/67040228/programmatically-select-marker-to-navigate-to-location-google-maps-flutter) I apologize if the format is incorrect, as I am not sure where to find out how to format issues.

I am trying to develop a user experience where the user is provided a list of venues to travel to, and upon selecting one of those locations, I want it to 
 1. Add a marker to the map
 2. Show an info window  
 3. Provide the option to navigate to the
    location.

I was able to use the information [from this PR][1] (that has no official documentation it seems) to go from this:

[![Before use of PR][2]][2]


To this:

[![Functionality after using the showMarkerInfo function][3]][3]


However, showing the marker info still does not make the given marker "active". When I select the marker, the functionality of the plugin actually displays options for navigating to the given location on the bottom right, like this:

[![Functionality of the Google_Maps_Flutter plugin when the marker is actually selected.][4]][4]


What I would like is for the selection of the venue at the bottom of the list to automatically display all three criteria in the third image with one press. That is, once again:
1. The marker of the location
2. The info window
3. The option to navigate to that location.

Right now, a user has to click the entry from the list at the bottom, and then rather un-intuitively *click the marker on the map* in order for the navigation options to appear. How would I go about implementing this functionality myself?

Here is my current code for changing the viewport and adding a marker:

```
    Future<void> goSomewhere(id, name, distance, address, lat, lng) async {
    final GoogleMapController controller = await _controller.future;
    controller.animateCamera(CameraUpdate.newCameraPosition(
        CameraPosition(target: LatLng(lat, lng), zoom: 14.0)));
    setState(() {
      _markers.add(Marker(
        markerId: MarkerId(id),
        position: LatLng(lat, lng),
        infoWindow: InfoWindow(
          title: name,
          snippet: address,
        ),
        onTap: () {
          //_pageController.jumpToPage(i);
        },
        icon: BitmapDescriptor.defaultMarker,
      ));
      print(MarkerId(id));
      controller.showMarkerInfoWindow(MarkerId(id));
    });
  }
```

As an aside, and slightly unrelated, it appears that the GoogleMaps controller does not update the marker states despite having a valid markerId calling showMarkerInfoWindow immediately after adding a marker. It says that the marker does not exist, despite the marker having a valid ID (and being able to print it). I've since had to update this code to:

```
Future<void> goSomewhere(id, name, distance, address, lat, lng) async {
    final GoogleMapController controller = await _controller.future;
    controller.animateCamera(CameraUpdate.newCameraPosition(
        CameraPosition(target: LatLng(lat, lng), zoom: 14.0)));
    setState(() {
      var tempId = MarkerId(id);
      _markers.add(Marker(
        markerId: MarkerId(id),
        position: LatLng(lat, lng),
        infoWindow: InfoWindow(
          title: name,
          snippet: address,
        ),
      ));
      print(MarkerId(id));

    });

    // TEMPORARY FIX TO GET THE INFO WINDOW TO SHOW UP.
    await Future.delayed(Duration(seconds: 1));
    controller.showMarkerInfoWindow(MarkerId(id));
  }
```

Once again, while this does add the marker and show the info window, it does *not* give the user options for navigating to the location *unless* the user clicks the marker. As a result of this, my product has a very sub-optimal user experience that is not super intuitive to the user. 


  [1]: https://github.com/flutter/plugins/pull/2181
  [2]: https://i.stack.imgur.com/BH2S0.png
  [3]: https://i.stack.imgur.com/uUiBv.png
  [4]: https://i.stack.imgur.com/fVgZZ.png