From 72d5567c4e7fbeba2ea90cc410237881819dc567 Mon Sep 17 00:00:00 2001 From: ztimson Date: Mon, 2 Sep 2019 21:15:55 -0400 Subject: [PATCH] fixed measure tool --- src/app/views/map/map.component.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/views/map/map.component.ts b/src/app/views/map/map.component.ts index 75b1c5d..516cdfb 100644 --- a/src/app/views/map/map.component.ts +++ b/src/app/views/map/map.component.ts @@ -214,12 +214,12 @@ export class MapComponent implements OnDestroy, OnInit { startMeasuring = menuItem => { let lastPoint; - this.sub = this.map.click.pipe(skip(1), take(2), finalize(() => this.map.delete(lastPoint))).subscribe(e => { + this.sub = this.map.click.pipe(skip(1), finalize(() => this.map.delete(lastPoint))).subscribe(e => { if (lastPoint) { menuItem.enabled = false; let measurement = {latlng: {lat: lastPoint.getLatLng().lat, lng: lastPoint.getLatLng().lng}, latlng2: e.latlng}; this.syncService.addMeasurement(measurement); - return this.map.delete(lastPoint); + this.map.delete(lastPoint); } lastPoint = this.map.newMarker({latlng: e.latlng, color: '#ff4141'}); })