mirror of
https://github.com/DerTyp7/street-map-typescript.git
synced 2025-10-29 12:52:11 +01:00
moved serives into subfolder services
This commit is contained in:
@@ -1,13 +1,14 @@
|
||||
import { Component, OnInit, ElementRef, ViewChild} from '@angular/core';
|
||||
import { Nominatim } from '../interfaces/nominatim';
|
||||
import { NominatimService } from '../nominatim.service';
|
||||
import { NominatimService } from '../services/nominatim.service';
|
||||
import { Photon, PhotonFeatureCollection } from '../interfaces/photon';
|
||||
import { PhotonService } from '../photon.service';
|
||||
import { OsrmService } from '../osrm.service';
|
||||
import { PhotonService } from '../services/photon.service';
|
||||
import { OsrmService } from '../services/osrm.service';
|
||||
import { Osrm } from '../interfaces/osrm';
|
||||
import { AppComponent } from '../app.component';
|
||||
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'app-search',
|
||||
templateUrl: './search.component.html',
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { Nominatim } from './interfaces/nominatim';
|
||||
import { Nominatim } from '../interfaces/nominatim';
|
||||
import { Observable } from 'rxjs';
|
||||
|
||||
@Injectable({
|
||||
@@ -12,7 +12,7 @@ export class NominatimService{
|
||||
constructor(private http: HttpClient) { }
|
||||
|
||||
// sends a query request to Nominatim and gets response (https://nominatim.org/release-docs/develop/api/Search/)
|
||||
sendQueryRequest(q: string): Observable<Nominatim[]> {
|
||||
sendQueryRequest(q: string): Observable<Nominatim[]> {
|
||||
return this.http.get<Nominatim[]>("https://nominatim.openstreetmap.org/search.php?format=jsonv2&q=" + q);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { Observable } from 'rxjs';
|
||||
import { Osrm } from './interfaces/osrm';
|
||||
import { Osrm } from '../interfaces/osrm';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { PhotonFeatureCollection } from './interfaces/photon';
|
||||
import { PhotonFeatureCollection } from '../interfaces/photon';
|
||||
import { Observable } from 'rxjs';
|
||||
|
||||
@Injectable({
|
||||
Reference in New Issue
Block a user