From 2e17198e92d2f62b16ad4a651ecfd0fbc7429903 Mon Sep 17 00:00:00 2001 From: Janis Meister Date: Thu, 13 Jan 2022 09:56:35 +0100 Subject: [PATCH] added nominatim interface --- src/app/app.component.ts | 6 +++--- src/app/interfaces/nom.ts | 4 ---- src/app/interfaces/nominatim.ts | 16 ++++++++++++++++ 3 files changed, 19 insertions(+), 7 deletions(-) delete mode 100644 src/app/interfaces/nom.ts create mode 100644 src/app/interfaces/nominatim.ts diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 3f46199..0cd8cd5 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -11,7 +11,7 @@ import View from 'ol/View'; import TileLayer from 'ol/layer/Tile'; import XYZ from 'ol/source/XYZ'; import ZoomToExtent from 'ol/control/ZoomToExtent'; -import { Nom } from './interfaces/nom'; +import { Nominatim } from './interfaces/nominatim'; @@ -31,8 +31,8 @@ export class AppComponent implements AfterViewInit, OnInit { getValue(valueFrom:string, valueTo:string){ console.log("From " + valueFrom + " to " + valueTo); - this.http.get("https://nominatim.openstreetmap.org/search.php?format=jsonv2&q=" + valueFrom) - .subscribe((response: Nom[]) => console.log(response)) + this.http.get("https://nominatim.openstreetmap.org/search.php?format=jsonv2&q=" + valueFrom) + .subscribe((response: Nominatim) => console.log(response)) } ngOnInit() { diff --git a/src/app/interfaces/nom.ts b/src/app/interfaces/nom.ts deleted file mode 100644 index 6b5e6ab..0000000 --- a/src/app/interfaces/nom.ts +++ /dev/null @@ -1,4 +0,0 @@ - -export interface Nom { - boundingbox: Array; -} diff --git a/src/app/interfaces/nominatim.ts b/src/app/interfaces/nominatim.ts new file mode 100644 index 0000000..382c543 --- /dev/null +++ b/src/app/interfaces/nominatim.ts @@ -0,0 +1,16 @@ + +export interface Nominatim { + boundingbox: Array; + category: string; + display_name: string; + icon: string; + importance: number; + lat: string; + licence: string; + lon: string; + osm_id: number; + osm_type: string; + place_id: number; + place_rank: number; + type: string; +}