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,22 +1,16 @@
BR.Download = BR.Control.extend({
options: {
heading: 'Download'
},
onAdd: function (map) {
var container = BR.Control.prototype.onAdd.call(this, map);
return container;
},
BR.Download = L.Class.extend({
update: function (urls) {
var html = '<div class="value">';
if (urls.gpx) {
html += '<a href="' + urls.gpx + '" download="brouter.gpx">GPX</a> &middot; ';
html += '<a href="' + urls.kml + '" download="brouter.kml">KML</a> &middot; ';
html += '<a href="' + urls.geojson + '" download="brouter.geojson">GeoJSON</a> &middot; ';
html += '<a href="' + urls.csv + '" download="brouter.tsv">data CSV</a>';
if (urls) {
['gpx', 'kml', 'geojson', 'csv'].forEach(function(e, i, a) {
var a = L.DomUtil.get('dl-'+e);
a.setAttribute('href', urls[e]);
a.setAttribute('download', 'brouter.'+e);
a.removeAttribute('disabled');
})
}
html += '</div>';
this._content.innerHTML = html;
}
});
BR.download = function() {
return new BR.Download();
};