Merge branch 'develop' of https://git.akkerweb.nl/FarmMaps/FarmMapsLib into develop
All checks were successful
FarmMaps.Develop/FarmMapsLib/develop This commit looks good
All checks were successful
FarmMaps.Develop/FarmMapsLib/develop This commit looks good
This commit is contained in:
commit
7a1ba95212
@ -9,14 +9,14 @@ import {WeatherCurrentObservation} from '../models/weatherCurrentObservation';
|
|||||||
})
|
})
|
||||||
export class WeatherService {
|
export class WeatherService {
|
||||||
private apiUrl = '/api/v1/weather/currentobservation';
|
private apiUrl = '/api/v1/weather/currentobservation';
|
||||||
private apiKey = '5f17ef36283b49e9b099a1f4064fbf3d';
|
|
||||||
|
|
||||||
constructor(public httpClient: HttpClient, public appConfig: AppConfig) {
|
constructor(public httpClient: HttpClient, public appConfig: AppConfig) {
|
||||||
}
|
}
|
||||||
|
|
||||||
public GetCurrentObservation(centroid: number[]): Observable<WeatherCurrentObservation> {
|
public GetCurrentObservation(centroid: number[]): Observable<WeatherCurrentObservation> {
|
||||||
const endpoint = this.appConfig.getConfig('apiEndPoint');
|
const endpoint = this.appConfig.getConfig('weatherApiEndPoint');
|
||||||
const observationUrl = `${endpoint}${this.apiUrl}/?c=${centroid[0]},${centroid[1]}&key=${this.apiKey}`;
|
const apiKey = this.appConfig.getConfig('weatherApiKey');
|
||||||
|
const observationUrl = `${endpoint}${this.apiUrl}/?c=${centroid[0]},${centroid[1]}&key=${apiKey}`;
|
||||||
|
|
||||||
return this.httpClient.get<WeatherCurrentObservation>(observationUrl);
|
return this.httpClient.get<WeatherCurrentObservation>(observationUrl);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user