Skip to content

Commit

Permalink
delete route point on touch device
Browse files Browse the repository at this point in the history
  • Loading branch information
panaaj committed Sep 7, 2024
1 parent 5ef8db7 commit f3a69c6
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 13 deletions.
8 changes: 4 additions & 4 deletions src/app/app.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -808,8 +808,7 @@
</div>

<!-- Draw Help -->
@if((draw.enabled && draw.mode !== 'route') || (draw.modify &&
draw.modifyMode !== 'route')) {
@if((draw.enabled && draw.mode !== 'route') || draw.modify) {
<div class="mat-app-background measurePanel">
@if(draw.enabled) {
<div>
Expand Down Expand Up @@ -852,12 +851,12 @@
<li>Click and drag to move anchor.</li>
} @if(draw.forSave.id !== 'anchor') {
<li>Click and drag to move point.</li>
<li>Ctrl-Click to remove point from line.</li>
<li>Ctrl-Click or Right click to remove point from line.</li>
}
</ol>
</div>
</div>
}
} @if( !(draw.modify && draw.modifyMode === 'route')) {
<div style="text-align: center">
<!-- cancel Draw button -->
<a
Expand All @@ -871,6 +870,7 @@
{{ draw.modify ? 'FINISH' : 'CANCEL' }}
</a>
</div>
}
</div>
}

Expand Down
8 changes: 1 addition & 7 deletions src/app/modules/map/fb-map.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,7 @@ import {
import { FreeboardOpenlayersModule } from 'src/app/modules/map/ol';
import { PipesModule } from 'src/app/lib/pipes';

import {
computeDestinationPoint,
getGreatCircleBearing,
getDistanceFromLine,
getDistance,
getPreciseDistance
} from 'geolib';
import { computeDestinationPoint, getGreatCircleBearing } from 'geolib';
import { toLonLat } from 'ol/proj';
import { Style, Stroke, Fill } from 'ol/style';
import { Collection, Feature } from 'ol';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,11 @@ export class InteractionModifyComponent {
features: this.features,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
deleteCondition: (e: MapBrowserEvent<any>) => {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
if (e.type === 'click' && (e.originalEvent as any).ctrlKey) {
if (
// eslint-disable-next-line @typescript-eslint/no-explicit-any
(e.type === 'click' && (e.originalEvent as any).ctrlKey) ||
e.type === 'contextmenu'
) {
return true;
} else {
return false;
Expand Down

0 comments on commit f3a69c6

Please sign in to comment.