Skip to content

Instantly share code, notes, and snippets.

@poltib
Created April 26, 2014 09:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save poltib/11315868 to your computer and use it in GitHub Desktop.
Save poltib/11315868 to your computer and use it in GitHub Desktop.
gmap_script_growpath
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