I hereby claim:
- I am poltib on github.
- I am poltib (https://keybase.io/poltib) on keybase.
- I have a public key ASAS40zf1vwhOYwwcfbvfVjahF8XwhsZXdCnOvZZjJVbNgo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
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) { |
var clear, close, dist, divMap, elevation_chart, grow_path, map, reset; | |
dist = document.getElementById("dist"); | |
reset = document.getElementById("reset"); | |
close = document.getElementById("close"); | |
clear = document.getElementById("clear"); | |
full = document.getElementById("full"); | |
divMap = document.getElementById("map_canvas"); | |
elevation_chart = document.getElementById('elevation_chart'); | |
chart = new google.visualization.ColumnChart(elevation_chart); | |
map = gm_init(); |
google.maps.LatLng.prototype.kmTo = function(a) { | |
var b, c, d, e, f, g, ra; | |
e = Math; | |
ra = e.PI / 180; | |
b = this.lat() * ra; | |
c = a.lat() * ra; | |
d = b - c; | |
g = this.lng() * ra - a.lng() * ra; | |
f = 2 * e.asin(e.sqrt(e.pow(e.sin(d / 2), 2) + e.cos(b) * e.cos(c) * e.pow(e.sin(g / 2), 2))); | |
return f * 6378.137; |
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; | |
} |
plot_elevation = function(results, status) { | |
var data, i; | |
elevation_req_active = false; | |
if (status !== google.maps.ElevationStatus.OK) { | |
return; | |
} | |
elevations = results; | |
data = new google.visualization.DataTable(); | |
data.addColumn('string', 'Sample'); | |
data.addColumn('number', 'Elevation'); |
draw_path = function(path) { | |
var pathRequest; | |
if (elevation_req_active || !path) { | |
r eturn; | |
} | |
pathRequest = { | |
path: path, | |
samples: SAMPLES | |
}; | |
elevation_req_active = true; |
poly_init = function(map) { | |
var poly_options; | |
poly_options = { | |
draggable: true, | |
editable: true, | |
geodesic: true, | |
map: map, | |
strokeColor: 'rgba(0,0,0,0.6)' | |
}; | |
return new google.maps.Polyline(poly_options); |
gm_init = function() { | |
var gm_center, gm_map_type, map_options; | |
gm_center = new google.maps.LatLng(50.633333, 5.566667); | |
gm_map_type = google.maps.MapTypeId.ROADMAP; | |
map_options = { | |
zoom: 14, | |
center: gm_center, | |
panControl: false, | |
backgroundColor: "rgba(0,0,0,0)", | |
mapTypeControl: false, |
var NUMBER_DOT_TWONUMBERS, SAMPLES, alert, calc_bounds, chart, display_on_map, draw_path, elevation_req_active, elevation_service, elevations, gm_init, gm_service, path, plot_elevation, poly_init; | |
NUMBER_DOT_TWONUMBERS = /^(\d+.)(\d{0,2})(\d+)/; | |
poly = 1; | |
chart = 1; | |
elevations = 1; |