AW-811: Changed weatherservice
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:
parent
1bec8c2038
commit
1cab239155
@ -9,14 +9,14 @@ import {WeatherCurrentObservation} from '../models/weatherCurrentObservation';
|
||||
})
|
||||
export class WeatherService {
|
||||
private apiUrl = '/api/v1/weather/currentobservation';
|
||||
private apiKey = '5f17ef36283b49e9b099a1f4064fbf3d';
|
||||
|
||||
constructor(public httpClient: HttpClient, public appConfig: AppConfig) {
|
||||
}
|
||||
|
||||
public GetCurrentObservation(centroid: number[]): Observable<WeatherCurrentObservation> {
|
||||
const endpoint = this.appConfig.getConfig('apiEndPoint');
|
||||
const observationUrl = `${endpoint}${this.apiUrl}/?c=${centroid[0]},${centroid[1]}&key=${this.apiKey}`;
|
||||
const endpoint = this.appConfig.getConfig('weatherApiEndPoint');
|
||||
const apiKey = this.appConfig.getConfig('weatherApiKey');
|
||||
const observationUrl = `${endpoint}${this.apiUrl}/?c=${centroid[0]},${centroid[1]}&key=${apiKey}`;
|
||||
|
||||
return this.httpClient.get<WeatherCurrentObservation>(observationUrl);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user