forked from MapComplete/MapComplete
Add statistics download button
This commit is contained in:
parent
16784270ce
commit
cd867bf2d1
2 changed files with 27 additions and 4 deletions
|
@ -345,11 +345,18 @@ export class GeoOperations {
|
|||
return <any>way
|
||||
}
|
||||
|
||||
public static toCSV(features: Feature[] | FeatureCollection): string {
|
||||
public static toCSV(features: Feature[] | FeatureCollection, options?: {
|
||||
ignoreTags?: RegExp
|
||||
}): string {
|
||||
const headerValuesSeen = new Set<string>()
|
||||
const headerValuesOrdered: string[] = []
|
||||
|
||||
function addH(key) {
|
||||
function addH(key: string) {
|
||||
if(options?.ignoreTags){
|
||||
if(key.match(options.ignoreTags)){
|
||||
return
|
||||
}
|
||||
}
|
||||
if (!headerValuesSeen.has(key)) {
|
||||
headerValuesSeen.add(key)
|
||||
headerValuesOrdered.push(key)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue