-
-
Save fitomad/70a49edf0eea534c64ab754ca9eb1d33 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
directions.route(directionRequest, function(error, results) { | |
if(error) | |
{ | |
console.log(error); | |
return; | |
} | |
var coordinates = Array(); | |
var routeCounter = 0; | |
results.routes.forEach(function(route) { | |
route.path.forEach(function(step) { | |
step.forEach(function(coordinate) { | |
coordinates.push(coordinate); | |
}); | |
}); | |
// Dibuja la ruta en el mapa | |
drawRoute(coordinates, mapCustomColor[routeCounter], true); | |
/// Muestra un DIV con las instrucciones de la ruta | |
showRoutePlan(routeCounter, route.distance, route.expectedTravelTime, route.steps); | |
// Preparados para la siguiente ruta | |
coordinates = Array(); | |
routeCounter++; | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment