Misc
This commit is contained in:
parent
da9aa17cc7
commit
7983b4633b
@ -12,6 +12,7 @@
|
|||||||
</form>
|
</form>
|
||||||
<mat-divider></mat-divider>
|
<mat-divider></mat-divider>
|
||||||
<div class="text-right py-2">
|
<div class="text-right py-2">
|
||||||
|
<button mat-button mat-dialog-close>Cancel</button>
|
||||||
<button mat-button type="submit" form="dimensionsForm" (click)="close()">Ok</button>
|
<button mat-button type="submit" form="dimensionsForm" (click)="close()">Ok</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -35,7 +35,8 @@ export class MapComponent implements OnInit {
|
|||||||
sub: Subscription;
|
sub: Subscription;
|
||||||
|
|
||||||
placeRelative = () => {
|
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 latlng = relativeLatLng({lat: this.position.latitude, lng: this.position.longitude}, dimensions[0], dimensions[1]);
|
||||||
let marker: Marker = {latlng: latlng, color: '#ff4141'};
|
let marker: Marker = {latlng: latlng, color: '#ff4141'};
|
||||||
this.syncService.addMarker(marker);
|
this.syncService.addMarker(marker);
|
||||||
@ -49,11 +50,8 @@ export class MapComponent implements OnInit {
|
|||||||
|
|
||||||
startCircle = menuItem => {
|
startCircle = menuItem => {
|
||||||
this.sub = this.map.click.pipe(skip(1), take(1)).subscribe(async e => {
|
this.sub = this.map.click.pipe(skip(1), take(1)).subscribe(async e => {
|
||||||
let dimensions = await this.dialog.open(DimensionsDialogComponent, {
|
let dimensions = await this.dialog.open(DimensionsDialogComponent, {data: ['Radius (m)'], panelClass: 'pb-0'}).afterClosed().toPromise();
|
||||||
data: ['Radius (m)'],
|
if(!dimensions) return;
|
||||||
disableClose: true,
|
|
||||||
panelClass: 'pb-0'
|
|
||||||
}).afterClosed().toPromise();
|
|
||||||
menuItem.enabled = false;
|
menuItem.enabled = false;
|
||||||
let circle = {latlng: e.latlng, radius: dimensions[0] || 500, color: '#ff4141'};
|
let circle = {latlng: e.latlng, radius: dimensions[0] || 500, color: '#ff4141'};
|
||||||
this.syncService.addCircle(circle);
|
this.syncService.addCircle(circle);
|
||||||
|
Loading…
Reference in New Issue
Block a user