forked from MapComplete/MapComplete
Added cyclofix capacity cargo; covered; non-bike shop; pump dyn title
This commit is contained in:
parent
a7bb4a1fcc
commit
948ff74a8b
23 changed files with 624 additions and 91 deletions
|
@ -1,37 +1,34 @@
|
|||
import {TagsFilter} from "./TagsFilter";
|
||||
import * as OsmToGeoJson from "osmtogeojson";
|
||||
import * as $ from "jquery";
|
||||
import {Basemap} from "./Basemap";
|
||||
import {UIEventSource} from "../UI/UIEventSource";
|
||||
|
||||
|
||||
/**
|
||||
* Interfaces overpass to get all the latest data
|
||||
*/
|
||||
export class Overpass {
|
||||
|
||||
|
||||
private _filter: TagsFilter;
|
||||
public static testUrl: string = null;
|
||||
private _filter: TagsFilter
|
||||
public static testUrl: string = null
|
||||
|
||||
constructor(filter: TagsFilter) {
|
||||
this._filter = filter;
|
||||
this._filter = filter
|
||||
}
|
||||
|
||||
private buildQuery(bbox: string): string {
|
||||
const filters = this._filter.asOverpass();
|
||||
let filter = "";
|
||||
public buildQuery(bbox: string): string {
|
||||
const filters = this._filter.asOverpass()
|
||||
console.log(filters)
|
||||
let filter = ""
|
||||
for (const filterOr of filters) {
|
||||
filter += 'nwr' + filterOr + ';';
|
||||
filter += 'nwr' + filterOr + ';'
|
||||
}
|
||||
const query =
|
||||
'[out:json][timeout:25]' + bbox + ';(' + filter + ');out body;>;out skel qt;';
|
||||
console.log(query);
|
||||
return "https://overpass-api.de/api/interpreter?data=" + encodeURIComponent(query);
|
||||
'[out:json][timeout:25]' + bbox + ';(' + filter + ');out body;>;out skel qt;'
|
||||
console.log(query)
|
||||
return "https://overpass-api.de/api/interpreter?data=" + encodeURIComponent(query)
|
||||
}
|
||||
|
||||
|
||||
queryGeoJson(bbox: string, continuation: ((any) => void), onFail: ((reason) => void)): void {
|
||||
let query = this.buildQuery(bbox);
|
||||
let query = this.buildQuery(bbox)
|
||||
|
||||
if(Overpass.testUrl !== null){
|
||||
console.log("Using testing URL")
|
||||
|
@ -53,9 +50,5 @@ export class Overpass {
|
|||
const geojson = OsmToGeoJson.default(json);
|
||||
continuation(geojson);
|
||||
}).fail(onFail)
|
||||
|
||||
;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue