add GeoJSON download

This commit is contained in:
Norbert Renner 2014-08-21 15:17:04 +02:00
parent 59d4acc3c6
commit 25f50434d0
2 changed files with 3 additions and 1 deletions

View file

@ -9,10 +9,11 @@ BR.Download = BR.Control.extend({
},
update: function (urls) {
var html = '<div class="label">&nbsp;</div><div class="value">';
var html = '<div class="value">';
if (urls.gpx) {
html += '<a href="' + urls.gpx + '" download="brouter.gpx" target="_blank">GPX</a> &middot; ';
html += '<a href="' + urls.kml + '" download="brouter.kml" target="_blank">KML</a> &middot; ';
html += '<a href="' + urls.geojson + '" download="brouter.geojson">GeoJSON</a> &middot; ';
html += '<a href="' + urls.csv + '" download="brouter.tsv" target="_blank">CSV</a>';
}
html += '</div>'

View file

@ -179,6 +179,7 @@
if (latLngs.length > 1) {
urls.gpx = router.getUrl(latLngs, 'gpx');
urls.kml = router.getUrl(latLngs, 'kml');
urls.geojson = router.getUrl(latLngs, 'geojson');
urls.csv = router.getUrl(latLngs, 'csv');
}