Reformat all files with prettier

This commit is contained in:
Pieter Vander Vennet 2022-09-08 21:40:48 +02:00
parent e22d189376
commit b541d3eab4
382 changed files with 50893 additions and 35566 deletions

View file

@ -1,23 +1,27 @@
import State from "../../State";
import {Utils} from "../../Utils";
import {BBox} from "../BBox";
import State from "../../State"
import { Utils } from "../../Utils"
import { BBox } from "../BBox"
export interface GeoCodeResult {
display_name: string,
lat: number, lon: number, boundingbox: number[],
osm_type: "node" | "way" | "relation",
display_name: string
lat: number
lon: number
boundingbox: number[]
osm_type: "node" | "way" | "relation"
osm_id: string
}
export class Geocoding {
private static readonly host = "https://nominatim.openstreetmap.org/search?";
private static readonly host = "https://nominatim.openstreetmap.org/search?"
static async Search(query: string): Promise<GeoCodeResult[]> {
const b = State?.state?.currentBounds?.data ?? BBox.global;
const url = Geocoding.host + "format=json&limit=1&viewbox=" +
const b = State?.state?.currentBounds?.data ?? BBox.global
const url =
Geocoding.host +
"format=json&limit=1&viewbox=" +
`${b.getEast()},${b.getNorth()},${b.getWest()},${b.getSouth()}` +
"&accept-language=nl&q=" + query;
return Utils.downloadJson(url)
"&accept-language=nl&q=" +
query
return Utils.downloadJson(url)
}
}