Add geolocator service
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good
This commit is contained in:
parent
ff018d9db1
commit
5db24cc63d
@ -17,6 +17,7 @@ import { EventService } from './services/event.service';
|
||||
import { TypeaheadService } from './services/typeahead.service';
|
||||
import { UserService } from './services/user.service';
|
||||
import { ImageService } from './services/image.service';
|
||||
import { GeolocatorService } from './services/geolocator.service';
|
||||
import { WeatherService} from './services/weather.service';
|
||||
import { AppConfig } from './shared/app.config';
|
||||
import { AccessTokenInterceptor } from "./shared/accesstoken.interceptor";
|
||||
@ -44,6 +45,7 @@ export {
|
||||
TypeaheadService,
|
||||
UserService,
|
||||
ImageService,
|
||||
GeolocatorService,
|
||||
WeatherService,
|
||||
AppConfig,
|
||||
AccessTokenInterceptor,
|
||||
|
21
projects/common/src/fm/services/geolocator.service.ts
Normal file
21
projects/common/src/fm/services/geolocator.service.ts
Normal file
@ -0,0 +1,21 @@
|
||||
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):any {
|
||||
return this.httpClient.get<any>(`${this.ApiEndpoint()}/api/v1/service/geocode?address=${address}`)
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user