Web APIs for Angular

High quality lightweight wrappers for native Web APIs for idiomatic use with Angular
Home
Angular does not have any built-in instruments to use Geolocation API . This is an Observable based abstraction over Geolocation API to use with Angular

How 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