Add mssing assets

This commit is contained in:
Pieter Vander Vennet 2021-09-29 16:55:05 +02:00
parent c2d477c97a
commit 09897b47e0
11 changed files with 104 additions and 89 deletions

View file

@ -1,9 +1,9 @@
import * as OsmToGeoJson from "osmtogeojson";
import Bounds from "../../Models/Bounds";
import {TagsFilter} from "../Tags/TagsFilter";
import RelationsTracker from "./RelationsTracker";
import {Utils} from "../../Utils";
import {UIEventSource} from "../UIEventSource";
import {BBox} from "../BBox";
/**
* Interfaces overpass to get all the latest data
@ -11,7 +11,7 @@ import {UIEventSource} from "../UIEventSource";
export class Overpass {
public static testUrl: string = null
private _filter: TagsFilter
private readonly _interpreterUrl: UIEventSource<string>;
private readonly _interpreterUrl: string;
private readonly _timeout: UIEventSource<number>;
private readonly _extraScripts: string[];
private _includeMeta: boolean;
@ -19,7 +19,7 @@ export class Overpass {
constructor(filter: TagsFilter, extraScripts: string[],
interpreterUrl: UIEventSource<string>,
interpreterUrl: string,
timeout: UIEventSource<number>,
relationTracker: RelationsTracker,
includeMeta = true) {
@ -31,9 +31,9 @@ export class Overpass {
this._relationTracker = relationTracker
}
public async queryGeoJson(bounds: Bounds): Promise<[any, Date]> {
public async queryGeoJson(bounds: BBox): Promise<[any, Date]> {
let query = this.buildQuery("[bbox:" + bounds.south + "," + bounds.west + "," + bounds.north + "," + bounds.east + "]")
let query = this.buildQuery("[bbox:" + bounds.getSouth() + "," + bounds.getWest() + "," + bounds.getNorth() + "," + bounds.getEast() + "]")
if (Overpass.testUrl !== null) {
console.log("Using testing URL")
@ -68,6 +68,6 @@ export class Overpass {
}
const query =
`[out:json][timeout:${this._timeout.data}]${bbox};(${filter});out body;${this._includeMeta ? 'out meta;' : ''}>;out skel qt;`
return `${this._interpreterUrl.data}?data=${encodeURIComponent(query)}`
return `${this._interpreterUrl}?data=${encodeURIComponent(query)}`
}
}