@Sweg wrote:
I am getting my current location using Geolocation below:
ngAfterViewInit(): void { this.getLoc().then((resp) => { this.initMap(resp.coords.latitude, resp.coords.longitude); }, er => { alert('Cannot retrieve Location') }); } getLoc() { return this.geolocation.getCurrentPosition( { maximumAge: 1000, timeout: 5000, enableHighAccuracy: true }); }
The above code retrieves my current location when I open up the app.
But now when the user has the app open, I want their location to be updated in realtime.
I.e. If I have the app open, & start walking, I want my longitude & latitude values to be updated on the map I’m initiating in
ngAfterViewInit()
.Can someone please tell me what changes I need to make to add this functionality?
Posts: 1
Participants: 1