diff --git a/lang/ast.json b/lang/ast.json index 4ca40ef9..6792c3f9 100644 --- a/lang/ast.json +++ b/lang/ast.json @@ -3,9 +3,12 @@ "category-info-tooltip": "", "closed": "", "default": "", + "download:geojson": "", + "edit": "", "error": "", "facilities": "", "header:attributes": "", + "header:export": "", "header:osm_meta": "", "images": "", "loading": "", diff --git a/lang/ca.json b/lang/ca.json index aea8c0ec..92fbcbad 100644 --- a/lang/ca.json +++ b/lang/ca.json @@ -3,9 +3,12 @@ "category-info-tooltip": "", "closed": "", "default": "", + "download:geojson": "", + "edit": "", "error": "", "facilities": "", "header:attributes": "", + "header:export": "", "header:osm_meta": "", "images": "", "loading": "", diff --git a/lang/cs.json b/lang/cs.json index b2960b3a..6a00b20d 100644 --- a/lang/cs.json +++ b/lang/cs.json @@ -3,9 +3,12 @@ "category-info-tooltip": "", "closed": "", "default": "", + "download:geojson": "", + "edit": "", "error": "", "facilities": "", "header:attributes": "", + "header:export": "", "header:osm_meta": "", "images": "", "loading": "", diff --git a/lang/da.json b/lang/da.json index 887da9a0..246c041a 100644 --- a/lang/da.json +++ b/lang/da.json @@ -3,9 +3,12 @@ "category-info-tooltip": "", "closed": "", "default": "", + "download:geojson": "", + "edit": "", "error": "", "facilities": "", "header:attributes": "", + "header:export": "", "header:osm_meta": "", "images": "", "loading": "", diff --git a/lang/de.json b/lang/de.json index 5b9d4659..36a8c64e 100644 --- a/lang/de.json +++ b/lang/de.json @@ -3,6 +3,7 @@ "category-info-tooltip": "Info & Legende", "closed": "geschlossen", "default": "Standard", + "download:geojson": "Als GeoJSON runterladen", "edit": "bearbeiten", "error": { "message": "Fehler", @@ -10,6 +11,7 @@ }, "facilities": "Einrichtungen", "header:attributes": "Attribute", + "header:export": "Export", "header:osm_meta": "OSM Meta", "images": "Bilder", "loading": "Laden ...", diff --git a/lang/el.json b/lang/el.json index b871e0c4..92acb3fc 100644 --- a/lang/el.json +++ b/lang/el.json @@ -3,9 +3,12 @@ "category-info-tooltip": "", "closed": "", "default": "", + "download:geojson": "", + "edit": "", "error": "", "facilities": "", "header:attributes": "", + "header:export": "", "header:osm_meta": "", "images": "", "loading": "", diff --git a/lang/en.json b/lang/en.json index 56ac93ae..62a959c0 100644 --- a/lang/en.json +++ b/lang/en.json @@ -3,6 +3,7 @@ "category-info-tooltip": "Info & Map key", "closed": "closed", "default": "default", + "download:geojson": "Download as GeoJSON", "edit": "edit", "error": { "message": "Error", @@ -10,6 +11,7 @@ }, "facilities": "Facilities", "header:attributes": "Attributes", + "header:export": "Export", "header:osm_meta": "OSM Meta", "images": "Images", "loading": "Loading ...", diff --git a/lang/es.json b/lang/es.json index d909c601..62837550 100644 --- a/lang/es.json +++ b/lang/es.json @@ -3,9 +3,12 @@ "category-info-tooltip": "", "closed": "", "default": "", + "download:geojson": "", + "edit": "", "error": "", "facilities": "", "header:attributes": "", + "header:export": "", "header:osm_meta": "", "images": "", "loading": "", diff --git a/lang/et.json b/lang/et.json index c512322d..9e346130 100644 --- a/lang/et.json +++ b/lang/et.json @@ -3,9 +3,12 @@ "category-info-tooltip": "", "closed": "", "default": "", + "download:geojson": "", + "edit": "", "error": "", "facilities": "", "header:attributes": "", + "header:export": "", "header:osm_meta": "", "images": "", "loading": "", diff --git a/lang/fr.json b/lang/fr.json index 7db585e8..36c096dc 100644 --- a/lang/fr.json +++ b/lang/fr.json @@ -3,9 +3,12 @@ "category-info-tooltip": "Info & Légende", "closed": "Fermé", "default": "Par défaut", + "download:geojson": "", + "edit": "", "error": "Erreur", "facilities": "Aménagements", "header:attributes": "Attributs", + "header:export": "", "header:osm_meta": "Métadonnées OSM", "images": "Images", "loading": "Chargement...", diff --git a/lang/hu.json b/lang/hu.json index 5a40fc19..68765c34 100644 --- a/lang/hu.json +++ b/lang/hu.json @@ -3,9 +3,12 @@ "category-info-tooltip": "", "closed": "", "default": "", + "download:geojson": "", + "edit": "", "error": "", "facilities": "", "header:attributes": "", + "header:export": "", "header:osm_meta": "", "images": "", "loading": "", diff --git a/lang/it.json b/lang/it.json index f12357d1..caa1f358 100644 --- a/lang/it.json +++ b/lang/it.json @@ -3,9 +3,12 @@ "category-info-tooltip": "", "closed": "", "default": "", + "download:geojson": "", + "edit": "", "error": "", "facilities": "", "header:attributes": "", + "header:export": "", "header:osm_meta": "", "images": "", "loading": "", diff --git a/lang/ja.json b/lang/ja.json index 673916b9..d1d9466f 100644 --- a/lang/ja.json +++ b/lang/ja.json @@ -3,9 +3,12 @@ "category-info-tooltip": "", "closed": "", "default": "", + "download:geojson": "", + "edit": "", "error": "", "facilities": "", "header:attributes": "", + "header:export": "", "header:osm_meta": "", "images": "", "loading": "", diff --git a/lang/nl.json b/lang/nl.json index 2b24c2b1..0c555511 100644 --- a/lang/nl.json +++ b/lang/nl.json @@ -3,9 +3,12 @@ "category-info-tooltip": "", "closed": "", "default": "", + "download:geojson": "", + "edit": "", "error": "", "facilities": "", "header:attributes": "", + "header:export": "", "header:osm_meta": "", "images": "", "loading": "", diff --git a/lang/pl.json b/lang/pl.json index 102167c3..2dbff807 100644 --- a/lang/pl.json +++ b/lang/pl.json @@ -3,9 +3,12 @@ "category-info-tooltip": "", "closed": "", "default": "", + "download:geojson": "", + "edit": "", "error": "", "facilities": "", "header:attributes": "", + "header:export": "", "header:osm_meta": "", "images": "", "loading": "", diff --git a/lang/pt-br.json b/lang/pt-br.json index 81b4659f..a465f89c 100644 --- a/lang/pt-br.json +++ b/lang/pt-br.json @@ -3,6 +3,7 @@ "category-info-tooltip": "Info & Legenda", "closed": "fechado", "default": "padrão", + "download:geojson": "", "edit": "editar", "error": { "message": "Erro", @@ -10,6 +11,7 @@ }, "facilities": "Instalações", "header:attributes": "Atributos", + "header:export": "", "header:osm_meta": "OSM Meta", "images": "Imagens", "loading": "Carregando...", diff --git a/lang/pt.json b/lang/pt.json index 7c1edd92..6209ffe5 100644 --- a/lang/pt.json +++ b/lang/pt.json @@ -3,6 +3,7 @@ "category-info-tooltip": "Info & Legenda", "closed": "fechado", "default": "padrão", + "download:geojson": "", "edit": "editar", "error": { "message": "Erro", @@ -10,6 +11,7 @@ }, "facilities": "Instalações", "header:attributes": "Atributos", + "header:export": "", "header:osm_meta": "OSM Meta", "images": "Imagens", "loading": "A carregar...", diff --git a/lang/ro.json b/lang/ro.json index 379045bf..393b5e82 100644 --- a/lang/ro.json +++ b/lang/ro.json @@ -3,9 +3,12 @@ "category-info-tooltip": "", "closed": "", "default": "", + "download:geojson": "", + "edit": "", "error": "", "facilities": "", "header:attributes": "", + "header:export": "", "header:osm_meta": "", "images": "", "loading": "", diff --git a/lang/ru.json b/lang/ru.json index 6975b404..1c8389ad 100644 --- a/lang/ru.json +++ b/lang/ru.json @@ -3,9 +3,12 @@ "category-info-tooltip": "", "closed": "", "default": "", + "download:geojson": "", + "edit": "", "error": "", "facilities": "", "header:attributes": "", + "header:export": "", "header:osm_meta": "", "images": "", "loading": "", diff --git a/lang/sr.json b/lang/sr.json index 0b6086bc..b53e0904 100644 --- a/lang/sr.json +++ b/lang/sr.json @@ -3,9 +3,12 @@ "category-info-tooltip": "", "closed": "", "default": "", + "download:geojson": "", + "edit": "", "error": "", "facilities": "", "header:attributes": "", + "header:export": "", "header:osm_meta": "", "images": "", "loading": "", diff --git a/lang/template.json b/lang/template.json index 5fed86ae..09c4e48c 100644 --- a/lang/template.json +++ b/lang/template.json @@ -3,9 +3,12 @@ "category-info-tooltip": "", "closed": "", "default": "", + "download:geojson": "", + "edit": "", "error": "", "facilities": "", "header:attributes": "", + "header:export": "", "header:osm_meta": "", "images": "", "loading": "", diff --git a/lang/uk.json b/lang/uk.json index b84f6266..11018c7e 100644 --- a/lang/uk.json +++ b/lang/uk.json @@ -3,9 +3,12 @@ "category-info-tooltip": "", "closed": "", "default": "", + "download:geojson": "", + "edit": "", "error": "", "facilities": "", "header:attributes": "", + "header:export": "", "header:osm_meta": "", "images": "", "loading": "", diff --git a/src/index.js b/src/index.js index c1056d2f..b64148b0 100644 --- a/src/index.js +++ b/src/index.js @@ -237,7 +237,7 @@ function show (id, options, callback) { } window.showDetails = function (data, category) { - var div, h, dt, dd + var div, h, dt, dd, li, a var k var dom = document.getElementById('contentDetails') @@ -274,6 +274,22 @@ window.showDetails = function (data, category) { } ) + h = document.createElement('h3') + h.innerHTML = lang('header:export') + dom.appendChild(h) + + div = document.createElement('ul') + dom.appendChild(div) + + li = document.createElement('li') + div.appendChild(li) + + a = document.createElement('a') + a.download = data.id + '.json' + a.href = 'data:application/json;charset=UTF-8,' + encodeURIComponent(JSON.stringify(data.object.GeoJSON(), null, ' ')) + a.innerHTML = lang('download:geojson') + li.appendChild(a) + h = document.createElement('h3') h.innerHTML = lang('header:attributes') dom.appendChild(h)