Fix request canceling
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good

This commit is contained in:
Willem Dantuma
2021-03-05 18:41:09 +01:00
parent 9d5cd0fa88
commit aa308abbb0
3 changed files with 23 additions and 8 deletions

View File

@@ -7,7 +7,7 @@
<li class="border-top pt-1 pb-1 value" *ngFor="let layerValue of layers">
<div>{{layerValue.layerName}}</div>
<div>{{layerValue.date|date}}</div>
<div><span>{{layerValue.quantity}}</span> <span>{{layerValue.value}}</span><span>{{layerValue.unit}}</span></div>
<div><span class="mr-1">{{layerValue.quantity}}</span> <span class="mr-1 font-weight-bold">{{layerValue.value}}</span><span>{{layerValue.unit}}</span></div>
</li>
</ul>
<ng-template #no_data>

View File

@@ -5,8 +5,8 @@ import * as mapReducers from '../../../reducers/map.reducer';
import * as mapActions from '../../../actions/map.actions';
import { MapComponent } from 'ngx-openlayers';
import { ILayervalue } from '../../../models/layer.value';
import { Observable,interval } from 'rxjs';
import { debounce } from 'rxjs/operators';
import { Observable,interval,Subject } from 'rxjs';
import { debounce, throttle } from 'rxjs/operators';
import { toLonLat } from 'ol/proj';
import { toStringHDMS } from 'ol/coordinate';
import { ClipboardService } from 'ngx-clipboard'
@@ -37,12 +37,15 @@ export class LayerValuesComponent implements OnInit,AfterViewInit {
}
moveEndSubject = new Subject<any>();
ngAfterViewInit():void {
this.offsetY$ = this.containerRef.nativeElement.offsetTop;
this.offsetX$ = this.containerRef.nativeElement.offsetLeft;
this.map.instance.on('moveend', () => {
this.updateValuesLocation();
this.moveEndSubject.next({});
});
this.moveEndSubject.pipe(throttle(ev => interval(100))).subscribe(() => this.updateValuesLocation());
}
updateValuesLocation() {