22 lines
620 B
TypeScript
22 lines
620 B
TypeScript
import { Injectable } from '@angular/core';
|
|
import { Observable } from 'rxjs';
|
|
import { IUser } from '../models/user';
|
|
import { HttpClient, HttpHeaders } from "@angular/common/http";
|
|
import { AppConfig } from "../shared/app.config";
|
|
|
|
@Injectable({
|
|
providedIn: 'root',
|
|
})
|
|
export class GeolocatorService {
|
|
constructor(public httpClient: HttpClient, public appConfig: AppConfig) {
|
|
}
|
|
|
|
ApiEndpoint() {
|
|
return this.appConfig.getConfig("apiEndPoint");
|
|
}
|
|
|
|
geocode(address:string): Observable<any> {
|
|
return this.httpClient.get<any>(`${this.ApiEndpoint()}/api/v1/service/geocode?address=${address}`)
|
|
}
|
|
}
|