Updating UI to also fit on mobile devices. Fix #34

This commit is contained in:
Gautier Pelloux-Prayer 2016-11-26 20:54:59 +01:00
parent 1e26cb1027
commit d7e476db82
44 changed files with 555 additions and 1305 deletions

View file

@ -1,7 +1,6 @@
BR.Elevation = L.Control.Elevation.extend({
options: {
position: "leftpane",
width: 385,
width:$('#map').outerWidth(),
margins: {
top: 20,
right: 30,
@ -11,6 +10,23 @@ BR.Elevation = L.Control.Elevation.extend({
theme: "steelblue-theme" //purple
},
addBelow: function(map) {
// waiting for https://github.com/MrMufflon/Leaflet.Elevation/pull/66
// this.width($('#map').outerWidth());
this.options.width = $('#map').outerWidth();
if (this.getContainer() != null) {
this.remove(map);
}
function setParent(el, newParent) {
newParent.appendChild(el);
}
this.addTo(map);
// move elevation graph outside of the map
setParent(this.getContainer(), document.getElementById('elevation-chart'));
},
update: function(track, layer) {
this.clear();