positionChanged = new Subject();
getLocation() {
if ("geolocation" in navigator) {
navigator.geolocation.watchPosition((success) => {
this.lat = success.coords.latitude;
this.lon = success.coords.longitude;
this.positionChanged.next();
})
}
this.positionChanged.pipe(
mergeMap(()=>this.todayService.daitriecoordinatebi(this.lat, this.lon)))
.subscribe(data => {
this.amindiDGES = data;
})
}
Yorumlar
Yorum Gönder