Skip to content

Instantly share code, notes, and snippets.

@poltib
Created April 26, 2014 09:42
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/11315915 to your computer and use it in GitHub Desktop.
Save poltib/11315915 to your computer and use it in GitHub Desktop.
gmap_script_listeners
google.maps.event.addListener(map, 'click', function(evt) {
if (path.getLength() === 0) {
path.push(evt.latLng);
poly.setPath(path);
} else {
return grow_path(path.getAt(path.getLength() - 1), evt.latLng);
}
});
reset.addEventListener('click', function(evt) {
path.clear();
elevation_chart.style.display = 'none';
dist.childNodes[0].nodeValue = 'dist';
});
close.addEventListener('click', function(evt) {
if (path.getLength() !== 0) {
return grow_path(path.getAt(path.getLength() - 1), path.getAt(0));
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment