Stephan Bösch-Plepelits
6 years ago
25 changed files with 119 additions and 67 deletions
-
3lang/ast.json
-
3lang/ca.json
-
3lang/cs.json
-
3lang/da.json
-
3lang/de.json
-
3lang/el.json
-
4lang/en.json
-
3lang/es.json
-
3lang/et.json
-
3lang/fr.json
-
3lang/hu.json
-
3lang/it.json
-
3lang/ja.json
-
3lang/nl.json
-
3lang/pl.json
-
3lang/pt-br.json
-
3lang/pt.json
-
3lang/ro.json
-
3lang/ru.json
-
3lang/sr.json
-
3lang/template.json
-
3lang/uk.json
-
34src/ExportGeoJSON.js
-
20src/ExportOSMXML.js
-
65src/exportAll.js
@ -0,0 +1,34 @@ |
|||
class ExportGeoJSON { |
|||
constructor (conf) { |
|||
this.conf = conf |
|||
} |
|||
|
|||
each (ob, callback) { |
|||
callback(null, ob.object.GeoJSON(this.conf)) |
|||
} |
|||
|
|||
finishOne (object) { |
|||
return { |
|||
content: JSON.stringify(object, null, ' '), |
|||
fileType: 'application/json', |
|||
extension: 'geojson' |
|||
} |
|||
} |
|||
|
|||
finish (list) { |
|||
if (list.length) { |
|||
list = { |
|||
type: 'FeatureCollection', |
|||
features: list |
|||
} |
|||
} |
|||
|
|||
return { |
|||
content: JSON.stringify(list, null, ' '), |
|||
fileType: 'application/json', |
|||
extension: 'geojson' |
|||
} |
|||
} |
|||
} |
|||
|
|||
module.exports = ExportGeoJSON |
@ -0,0 +1,20 @@ |
|||
class ExportOSMXML { |
|||
constructor (conf) { |
|||
this.conf = conf |
|||
this.parentNode = document.createElement('osm') |
|||
} |
|||
|
|||
each (ob, callback) { |
|||
ob.object.exportOSMXML(this.conf, this.parentNode, callback) |
|||
} |
|||
|
|||
finish (list) { |
|||
return { |
|||
content: '<?xml version="1.0" encoding="UTF-8"?><osm version="0.6" generator="OpenStreetBrowser">' + this.parentNode.innerHTML + '</osm>', |
|||
fileType: 'application/xml', |
|||
extension: 'osm.xml' |
|||
} |
|||
} |
|||
} |
|||
|
|||
module.exports = ExportOSMXML |
Write
Preview
Loading…
Cancel
Save
Reference in new issue