Format CSV
This commit is contained in:
parent
00f2cead36
commit
0fc468a682
2 changed files with 16 additions and 0 deletions
14
js/format/Csv.js
Normal file
14
js/format/Csv.js
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
BR.Csv = {
|
||||
format: function (geoJson) {
|
||||
const separator = '\t';
|
||||
const newline = '\n';
|
||||
const messages = geoJson.features[0].properties.messages;
|
||||
let csv = '';
|
||||
|
||||
for (const entries of messages) {
|
||||
csv += entries.join(separator) + newline;
|
||||
}
|
||||
|
||||
return csv;
|
||||
},
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue