Updating UI to also fit on mobile devices. Fix #34
This commit is contained in:
parent
1e26cb1027
commit
d7e476db82
44 changed files with 555 additions and 1305 deletions
|
|
@ -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> · ';
|
||||
html += '<a href="' + urls.kml + '" download="brouter.kml">KML</a> · ';
|
||||
html += '<a href="' + urls.geojson + '" download="brouter.geojson">GeoJSON</a> · ';
|
||||
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();
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue