I am trying to add InfoWindow to a route route. There are many examples for adding InfoWindow to a marker event listener.
But how can I move InfoWindow to show on the actual planned route from one marker to another. Someone already tried to ask this question before, but did not answer ( InfoWindow on Directions Route ).
In any case, I did a lot of search queries and found only one question similar to this question, but again there is no answer to it.
I tried infowindow.open(map,this) in the marker event in the callback, but it will open InfoWindow at the marker position. I just want to show the duration and distance, like Google. Something like an attached image
var infowindow2 = new google.maps.InfoWindow(); distanceService.getDistanceMatrix(distanceRequest, function (response, status) { if (status == "OK") { infowindow2.setContent(response.rows[0].elements[0].distance.text + "<br>" + response.rows[0].elements[0].duration.text + " ") } else { alert("Error: " + status) } }) infowindow2.open(map, this);

source share