Maintenance scheduled for Thursday, January 27th at 15:00 MST. Expected downtime <1 hour.

Commit 602c5be0 authored by Jeremy M Fee's avatar Jeremy M Fee Committed by Edward J Hunter
Browse files

Add reference place to places service, nearby-places component

parent b1051482
<ng-container *ngIf="placesService.places$ | async as places">
<geoserve-nearby-place-list [places]="places"></geoserve-nearby-place-list>
</ng-container>
\ No newline at end of file
<geoserve-nearby-place-list
[places]="places"
[referencePlace]="placesService.referencePlace"
></geoserve-nearby-place-list>
</ng-container>
export interface Place {
admin1_code: string;
admin1_name: string;
azimuth: number | string;
country_code: string;
country_name: string;
distance: number;
elevation: number;
feature_class: string;
feature_code: string;
admin1_code?: string;
admin1_name?: string;
azimuth?: number | string;
country_code?: string;
country_name?: string;
distance?: number;
elevation?: number;
feature_class?: string;
feature_code?: string;
latitude: number;
longitude: number;
name: string;
population: number;
name?: string;
population?: number;
}
......@@ -11,8 +11,11 @@ import { Feature } from './feature';
@Injectable()
export class PlacesService {
places$ = new BehaviorSubject<Place[]>(null);
readonly PLACES_URL = environment.apiUrl + 'places.json';
referencePlace: Place;
constructor(private http: HttpClient) {}
buildUrl(latitude: number, longitude: number): string {
......@@ -59,6 +62,10 @@ export class PlacesService {
}
);
this.referencePlace = {
latitude,
longitude
};
this.places$.next(places);
});
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment