forked from MapComplete/MapComplete
Add possibility to use a cutom overpass script, add 'grassfields in parks'-layer
This commit is contained in:
parent
0d51015cc8
commit
f659bc1141
40 changed files with 499 additions and 222 deletions
32
Customizations/JSON/SourceConfig.ts
Normal file
32
Customizations/JSON/SourceConfig.ts
Normal file
|
@ -0,0 +1,32 @@
|
|||
import {TagsFilter} from "../../Logic/Tags";
|
||||
|
||||
export default class SourceConfig {
|
||||
|
||||
osmTags?: TagsFilter;
|
||||
overpassScript?: string;
|
||||
geojsonSource?: string;
|
||||
|
||||
constructor(params: {
|
||||
osmTags?: TagsFilter,
|
||||
overpassScript?: string,
|
||||
geojsonSource?: string
|
||||
}) {
|
||||
|
||||
let defined = 0;
|
||||
if (params.osmTags) {
|
||||
defined++;
|
||||
}
|
||||
if (params.overpassScript) {
|
||||
defined++;
|
||||
}
|
||||
if (params.geojsonSource) {
|
||||
defined++;
|
||||
}
|
||||
if (defined == 0) {
|
||||
throw "Source: nothing correct defined in the source"
|
||||
}
|
||||
this.osmTags = params.osmTags;
|
||||
this.overpassScript = params.overpassScript;
|
||||
this.geojsonSource = params.geojsonSource;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue