From 7983b4633bb0de03642637ac71a5bdad8f765222 Mon Sep 17 00:00:00 2001 From: ztimson Date: Sat, 31 Aug 2019 15:02:11 -0400 Subject: [PATCH] Misc --- .../dimensionsDialog/dimensionsDialog.component.html | 1 + src/app/views/map/map.component.ts | 10 ++++------ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/app/components/dimensionsDialog/dimensionsDialog.component.html b/src/app/components/dimensionsDialog/dimensionsDialog.component.html index c7e1cd2..e72fa8b 100644 --- a/src/app/components/dimensionsDialog/dimensionsDialog.component.html +++ b/src/app/components/dimensionsDialog/dimensionsDialog.component.html @@ -12,6 +12,7 @@
+
diff --git a/src/app/views/map/map.component.ts b/src/app/views/map/map.component.ts index 7c5d36d..1cc5a5f 100644 --- a/src/app/views/map/map.component.ts +++ b/src/app/views/map/map.component.ts @@ -35,7 +35,8 @@ export class MapComponent implements OnInit { sub: Subscription; placeRelative = () => { - this.dialog.open(DimensionsDialogComponent, {data: ['Distance (m)', 'Baring']}).afterClosed().subscribe(dimensions => { + this.dialog.open(DimensionsDialogComponent, {data: ['Distance (m)', 'Baring'], panelClass: 'pb-0'}).afterClosed().subscribe(dimensions => { + if(!dimensions) return; let latlng = relativeLatLng({lat: this.position.latitude, lng: this.position.longitude}, dimensions[0], dimensions[1]); let marker: Marker = {latlng: latlng, color: '#ff4141'}; this.syncService.addMarker(marker); @@ -49,11 +50,8 @@ export class MapComponent implements OnInit { startCircle = menuItem => { this.sub = this.map.click.pipe(skip(1), take(1)).subscribe(async e => { - let dimensions = await this.dialog.open(DimensionsDialogComponent, { - data: ['Radius (m)'], - disableClose: true, - panelClass: 'pb-0' - }).afterClosed().toPromise(); + let dimensions = await this.dialog.open(DimensionsDialogComponent, {data: ['Radius (m)'], panelClass: 'pb-0'}).afterClosed().toPromise(); + if(!dimensions) return; menuItem.enabled = false; let circle = {latlng: e.latlng, radius: dimensions[0] || 500, color: '#ff4141'}; this.syncService.addCircle(circle);