Refactoring: reorder parameters in overpass, remove old script

This commit is contained in:
Pieter Vander Vennet 2025-05-07 15:35:35 +02:00
parent 1ef82ef6cc
commit bb33c43950
6 changed files with 13 additions and 122 deletions

View file

@ -5,7 +5,8 @@ import { BBox } from "../BBox"
import osmtogeojson from "osmtogeojson"
import { FeatureCollection, Geometry } from "geojson"
import { OsmTags } from "../../Models/OsmFeature"
;("use strict")
("use strict")
/**
* Interfaces overpass to get all the latest data
*/
@ -17,9 +18,9 @@ export class Overpass {
private readonly _includeMeta: boolean
constructor(
filter: TagsFilter,
extraScripts: string[],
interpreterUrl: string,
filter: TagsFilter,
extraScripts: string[] = [],
timeout?: Store<number>,
includeMeta = true
) {
@ -146,7 +147,7 @@ export class Overpass {
* Little helper method to quickly open overpass-turbo in the browser
*/
public static AsOverpassTurboLink(tags: TagsFilter) {
const overpass = new Overpass(tags, [], "", undefined, false)
const overpass = new Overpass("", tags, [], undefined, false)
const script = overpass.buildScript("", "({{bbox}})", true)
const url = "http://overpass-turbo.eu/?Q="
return url + encodeURIComponent(script)