Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ghsc
Hazards Development Team
earthquake-geoserve-ui
Commits
602c5be0
Commit
602c5be0
authored
Sep 25, 2019
by
Jeremy M Fee
Committed by
Edward J Hunter
Oct 15, 2021
Browse files
Add reference place to places service, nearby-places component
parent
b1051482
Changes
3
Hide whitespace changes
Inline
Side-by-side
projects/hazdev-ng-geoserve-output/src/lib/nearby-places/nearby-places.component.html
View file @
602c5be0
<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>
projects/hazdev-ng-geoserve-output/src/lib/place.ts
View file @
602c5be0
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
;
}
projects/hazdev-ng-geoserve-output/src/lib/places.service.ts
View file @
602c5be0
...
...
@@ -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
);
});
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment