Observable
based abstraction over
Geolocation API
to use with
AngularHow to use
Usage is pretty simple: just import service in your component and subscribe to it. Service extends Observable
and will emit the Position
object.
You also can use async pipe
Single position
If you need to get position just once and stop observing user location, you can subscribe to geolocation$
and use take(1)
RxJS operator. Service is cold, meaning if there are no Subscribers, it doesn't track position