Skip to content

Instantly share code, notes, and snippets.

@message
Created July 15, 2013 18:38
Show Gist options
  • Save message/6002283 to your computer and use it in GitHub Desktop.
Save message/6002283 to your computer and use it in GitHub Desktop.
var directionsDisplay = new google.maps.DirectionsRenderer();
var directionsService = new google.maps.DirectionsService();
directionsDisplay.setMap(wiid7.getAttrs().gmap);
waypts = [
// ЮРКАЛНСКИЙ ОБРЫВИСТЫЙ БЕРЕГ
{
location: "57.016254,21.383171",
stopover: true
}
// РАДИОАСТРОНОМИЧЕСКИЙ ЦЕНТР В ИРБЕНЕ
, {
location: "57.554295,21.857214",
stopover: true
}
// СТАРИННЫЙ КИРПИЧНЫЙ МОСТ ЧЕРЕЗ ВЕНТУ
, {
location: "56.969994,21.977451",
stopover: true
}
// НАЦИОНАЛЬНЫЙ ПАРК "СЛИТЕРЕ"
, {
location: "57.696259,22.391167",
stopover: true
}
// ПРИРОДНЫЙ ПАРК "ЛАУМУ" Пчёлы
, {
location: "57.380417,22.536049",
stopover: true
}
// САБИЛЬСКАЯ ВИННАЯ ГОРА
, {
location: "57.047832,22.570381",
stopover: true
}
, {
location: "Dobele, Latvia",
stopover: true
}
// Поместье «Кукшу» KUKŠU MUIŽA
, {
location: "56.977478,22.858232",
stopover: true
}
];
var request = {
origin: 'Riga, Latvia',
destination: 'Riga, Latvia',
waypoints: waypts,
optimizeWaypoints: true,
travelMode: google.maps.TravelMode.DRIVING
};
directionsService.route(request, function(response, status) {
if (status == google.maps.DirectionsStatus.OK) {
directionsDisplay.setDirections(response);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment