brouter-web/js/plugin/Elevation.js
Norbert Renner 929ef35a12 leaflet.elevation: disable sync from track for now; force master in bower
(master: 0.0.4, relases: 0.0.3, bower.json: 0.0.2); use lowercase as in registry
2015-05-23 13:31:26 +02:00

30 lines
No EOL
904 B
JavaScript

BR.Elevation = L.Control.Elevation.extend({
options: {
position: "leftpane",
width: 385,
margins: {
top: 20,
right: 30,
bottom: 30,
left: 60
},
theme: "steelblue-theme" //purple
},
update: function(track, layer) {
this.clear();
// bring height indicator to front, because of track casing in BR.Routing
if (this._mouseHeightFocus) {
var g = this._mouseHeightFocus[0][0].parentNode;
g.parentNode.appendChild(g);
}
if (track && track.getLatLngs().length > 0) {
// TODO disabled track layer mouseover, as it doesn't really work
// with line marker and indicator does not get removed (no mouseout?)
//this.addData(track.toGeoJSON(), layer);
this.addData(track.toGeoJSON());
}
}
});