Note this question is related to the one I asked here
In my html I am creating a overlay to a google map with
<agm-map ngDraggable [latitude]="latitude" [longitude]="longitude" [zoom]="zoom" *ngIf="locations" (mapReady)="mapReady($event)" >
Where mapReady is defined as
mapReady($event: any) {
console.log("about fire init");
nite.init($event);
setInterval(nite.refresh(),10000);
}
Now the problem is that nite.refresh()
is supposed to fire every 10 seconds but it only fires one time. I'm not sure if this has something to do with my ngOnInit()
which has a
timer(0, 10000).pipe(
switchMap( _ => this.hawkerservice.fetchNews()
)).pipe( map(...)).subscribe()
like function in it. Could this be causing the problem? The nite.init(...)
is working fine i just need to be able to refresh the overlay without had refreshing the whole page which is what I am currently doing to get nite
to refresh. Any thoughts? sorry if english is not the best.