Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

289
Views
I have created routes in map, but when click on any route infowindow not showing

i have draw routes from Point A to Point B. I am not able to show route information on routes same as appears in google-map.

i need to make it look alike as google map.

and when user click on any route, same route should show selected.

left image custom, right image google maps

Following are the code.

function calculateRoutes(pierLocation, destinationLocation) {
  var request = {
    origin: document.getElementById("from").value,
    destination: document.getElementById("to").value,
    travelMode: "DRIVING",
    provideRouteAlternatives: true,
    unitSystem: google.maps.UnitSystem.IMPERIAL,
  };

  directionsService.route(request, function (result, status) {
    if (status === "OK") {
      directionsDisplay.setDirections(result);
      var summaryPanel = document.getElementById("directions-panel");
      summaryPanel.innerHTML = "";

      for (var x = 0; x < result.routes.length; x++) {
        new google.maps.DirectionsRenderer({
          map: map,
          directions: result,
          routeIndex: x,
        });

        summaryPanel.innerHTML += "<hr><br><b> Route " + (x + 1) + ":<br>";
        var route = result.routes[x];
        for (var y = 0; y < route.legs.length; y++) {
          var routeSegment = y + 1;
        }
      }
    } else {
      window.alert("Directions request failed due to " + status);
    }
  });
}
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!