Instantly share code, notes, and snippets.

Embed
What would you like to do?
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