mirror of
https://github.com/DerTyp7/street-map-typescript.git
synced 2025-10-29 12:52:11 +01:00
added nominatim interface
This commit is contained in:
@@ -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<Nom[]>("https://nominatim.openstreetmap.org/search.php?format=jsonv2&q=" + valueFrom)
|
||||
.subscribe((response: Nom[]) => console.log(response))
|
||||
this.http.get<Nominatim>("https://nominatim.openstreetmap.org/search.php?format=jsonv2&q=" + valueFrom)
|
||||
.subscribe((response: Nominatim) => console.log(response))
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
|
||||
export interface Nom {
|
||||
boundingbox: Array<string>;
|
||||
}
|
||||
16
src/app/interfaces/nominatim.ts
Normal file
16
src/app/interfaces/nominatim.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
|
||||
export interface Nominatim {
|
||||
boundingbox: Array<string>;
|
||||
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;
|
||||
}
|
||||
Reference in New Issue
Block a user