Created
April 26, 2014 09:40
-
-
Save poltib/11315868 to your computer and use it in GitHub Desktop.
gmap_script_growpath
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
grow_path = function(origin, destination) { | |
return gm_service.route({ | |
origin: origin, | |
destination: destination, | |
travelMode: google.maps.DirectionsTravelMode.WALKING | |
}, function(result, status) { | |
var coords, i, _ref; | |
if (status !== google.maps.DirectionsStatus.OK) { | |
return; | |
} | |
_ref = result.routes[0].overview_path; | |
for (i = 0; i < _ref.length; i += 1) { | |
path.push(_ref[i]); | |
} | |
draw_path(path.j); | |
dist.childNodes[0].textContent = poly.inKm() + 'km'; | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment