I want to draw a route without traffic calculation. I try distance matrix service but ı can't find solution so when the response back from distance matrix service ı want to compare the routes and send shortest path to drawing but ı failed that too... Can you guys help or suggest anything?
directionsService
.route({
origin: document.getElementById("start").value,
destination: document.getElementById("end").value,
travelMode: "DRIVING",
unitSystem: google.maps.UnitSystem.METRIC,
drivingOptions: {
departureTime: new Date(Date.now()),
trafficModel: 'pessimistic'
}
})
.then((response) => {
directionsRenderer.setDirections(response);
console.log(response);
for (var i = 0; i < response.routes.length; i++) {
shortest.push(response.routes[0].legs[i].distance.value);
}
console.log(shortest);
})