Created
April 23, 2014 03:22
-
-
Save everdaniel/11201824 to your computer and use it in GitHub Desktop.
Driving Directions / GMap3
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
var destinations = new Array(); | |
destinations.push('Wattle Glen, Diamond Creek, Victoria 3089'); | |
destinations.push('Watsonia, Diamond Creek, Victoria 3089'); | |
destinations.push('St Helena, Diamond Creek, Victoria 3089'); | |
destinations.push('Plenty, Diamond Creek, Victoria 3089'); | |
destinations.push('Montmorency, Diamond Creek, Victoria 3089'); | |
destinations.push('Hurstbridge, Diamond Creek, Victoria 3089'); | |
destinations.push('Bundoora, Diamond Creek, Victoria 3089'); | |
destinations.push('Doreen, Diamond Creek, Victoria 3089'); | |
destinations.push('Eltham, Diamond Creek, Victoria 3089'); | |
destinations.push('Greensborough, Diamond Creek, Victoria 3089'); | |
$.each(destinations, function(index, neighborhood) { | |
$("#test").gmap3({ | |
getroute:{ | |
options:{ | |
origin: neighborhood, | |
destination: '10/331 Diamond Creek Road Diamond Creek VIC 3089', | |
travelMode: google.maps.DirectionsTravelMode.DRIVING | |
}, | |
callback: function(results){ | |
if (!results) return; | |
$(this).gmap3({ | |
map:{ | |
options:{ | |
zoom: 13, | |
center: [-37.677511, 145.127850] | |
} | |
}, | |
directionsrenderer:{ | |
container: $(document.createElement("div")).addClass("googlemap").insertAfter($("#test")), | |
options:{ | |
directions:results | |
} | |
} | |
}); | |
} | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment