Skip to content

Instantly share code, notes, and snippets.

@salimkayabasi
Created May 15, 2014 20:26
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 salimkayabasi/220d0b0e99ce830f5de6 to your computer and use it in GitHub Desktop.
Save salimkayabasi/220d0b0e99ce830f5de6 to your computer and use it in GitHub Desktop.
Draw route step by step on Google Maps
setTimeout(function () {
Map.zoomOut(1)
if (!canRate) {
Map.travelRoute({
origin: origin,
destination: destination,
travelMode: 'walking',
step: function (e) {
setTimeout(function () {
Map.drawPolyline({
path: e.path,
strokeColor: '#ff2800',
strokeOpacity: 0.4,
strokeWeight: 10
});
}, 400 * e.step_number)
}
});
}
}, 200)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment