diff --git a/src/modules/drawing/components/useModifyInteraction.composable.js b/src/modules/drawing/components/useModifyInteraction.composable.js
index 589fadb1d..c34199dd8 100644
--- a/src/modules/drawing/components/useModifyInteraction.composable.js
+++ b/src/modules/drawing/components/useModifyInteraction.composable.js
@@ -1,4 +1,4 @@
-import { noModifierKeys, singleClick } from 'ol/events/condition'
+import { doubleClick, noModifierKeys, primaryAction } from 'ol/events/condition'
import ModifyInteraction from 'ol/interaction/Modify'
import { computed, inject, onBeforeUnmount, onMounted, watch } from 'vue'
import { useStore } from 'vuex'
@@ -27,6 +27,7 @@ export default function useModifyInteraction(features) {
const reverseLineStringExtension = computed(
() => store.state.drawing.reverseLineStringExtension
)
+ const isPhoneMode = computed(() => store.getters.isPhoneMode)
const olMap = inject('olMap')
const { willModify, debounceSaveDrawing } = useSaveKmlOnChange()
@@ -34,7 +35,15 @@ export default function useModifyInteraction(features) {
const modifyInteraction = new ModifyInteraction({
features,
style: editingVertexStyleFunction,
- deleteCondition: (event) => noModifierKeys(event) && singleClick(event),
+ condition: (event) =>
+ primaryAction(event) ||
+ (event.type === 'pointerdown' &&
+ event.originalEvent.button === 2 &&
+ noModifierKeys(event)), // To delete a point with right click (contextmenu) one has to first select the point and then right click on it, therefore this select vertex condition is needed
+ deleteCondition: (event) =>
+ isPhoneMode.value
+ ? doubleClick(event)
+ : event.type === 'contextmenu' && noModifierKeys(event),
// This seems to be calculated differently than the hitTolerance properties of
// SelectInteraction and forEachFeatureAtPixel. That's why we have to manually correct the
// value here.
diff --git a/src/modules/i18n/locales/de.json b/src/modules/i18n/locales/de.json
index e70217a23..3758ba5d0 100644
--- a/src/modules/i18n/locales/de.json
+++ b/src/modules/i18n/locales/de.json
@@ -407,9 +407,9 @@
"modify_color_label": "Farbe",
"modify_description": "Beschreibung",
"modify_existing_vertex_annotation": "Verschieben von Text: klicken und ziehen ",
- "modify_existing_vertex_linepolygon": "Klicke, um den Punkt zu löschen (mind. 2 Punkte).
Punkt verschieben: klicken und ziehen ",
+ "modify_existing_vertex_linepolygon": "Rechtsklicken, um den Punkt zu löschen (mind. 2 Punkte).
Punkt verschieben: klicken und ziehen ",
"modify_existing_vertex_marker": "Verschieben des Symbols: klicken und ziehen ",
- "modify_existing_vertex_measure": "Klicke, um den Punkt zu löschen (mind. 2 Punkte).
Punkt verschieben: klicken und ziehen ",
+ "modify_existing_vertex_measure": "Rechtsklicken, um den Punkt zu löschen (mind. 2 Punkte).
Punkt verschieben: klicken und ziehen ",
"modify_icon_category_babs-v2-de_label": "Zivile Signaturen",
"modify_icon_category_babs-v2-fr_label": "Zivile Signaturen",
"modify_icon_category_babs-v2-it_label": "Zivile Signaturen",
diff --git a/src/modules/i18n/locales/en.json b/src/modules/i18n/locales/en.json
index beac88f9a..04cbc7711 100644
--- a/src/modules/i18n/locales/en.json
+++ b/src/modules/i18n/locales/en.json
@@ -407,9 +407,9 @@
"modify_color_label": "Color",
"modify_description": "Description",
"modify_existing_vertex_annotation": "Click then drag to move the text",
- "modify_existing_vertex_linepolygon": "Click to delete the point (2 points min.)
Click then drag to move the point",
+ "modify_existing_vertex_linepolygon": "Right click to delete the point (2 points min.)
Click then drag to move the point",
"modify_existing_vertex_marker": "Click then drag to move the marker",
- "modify_existing_vertex_measure": "Click to delete the point (2 points min.)
Click then drag to move the point",
+ "modify_existing_vertex_measure": "Right click to delete the point (2 points min.)
Click then drag to move the point",
"modify_icon_category_babs-v2-de_label": "Civil symbols",
"modify_icon_category_babs-v2-fr_label": "Civil symbols",
"modify_icon_category_babs-v2-it_label": "Civil symbols",
diff --git a/src/modules/i18n/locales/fr.json b/src/modules/i18n/locales/fr.json
index ae0ee0606..d2a1d6670 100644
--- a/src/modules/i18n/locales/fr.json
+++ b/src/modules/i18n/locales/fr.json
@@ -407,9 +407,9 @@
"modify_color_label": "Couleur",
"modify_description": "Description",
"modify_existing_vertex_annotation": "Cliquer puis bouger le curseur pour déplacer l'annotation",
- "modify_existing_vertex_linepolygon": "Cliquer pour supprimer le point (2 points min.)
Cliquer puis bouger le curseur pour déplacer le point ",
+ "modify_existing_vertex_linepolygon": "Faire un clic droit pour supprimer le point (2 points min.)
Cliquer puis bouger le curseur pour déplacer le point ",
"modify_existing_vertex_marker": "Cliquer puis bouger le curseur pour déplacer le symbole",
- "modify_existing_vertex_measure": "Cliquer pour supprimer le point (2 points min.)
Cliquer puis bouger le curseur pour déplacer le point",
+ "modify_existing_vertex_measure": "Faire un clic droit pour supprimer le point (2 points min.)
Cliquer puis bouger le curseur pour déplacer le point",
"modify_icon_category_babs-v2-de_label": "Signes conventionnels civils",
"modify_icon_category_babs-v2-fr_label": "Signes conventionnels civils",
"modify_icon_category_babs-v2-it_label": "Signes conventionnels civils",
diff --git a/src/modules/i18n/locales/it.json b/src/modules/i18n/locales/it.json
index da96c5051..9ff936feb 100644
--- a/src/modules/i18n/locales/it.json
+++ b/src/modules/i18n/locales/it.json
@@ -407,9 +407,9 @@
"modify_color_label": "Colore",
"modify_description": "Descrizione",
"modify_existing_vertex_annotation": "Cliccare quindi trascinare per spostare il testo",
- "modify_existing_vertex_linepolygon": "Cliccare per eliminare il punto (2 punti min.)
Cliccare quindi trascinare per spostare il punto",
+ "modify_existing_vertex_linepolygon": "Fare clic con il tasto destro del mouse per eliminare il punto (2 punti min.)
Cliccare quindi trascinare per spostare il punto",
"modify_existing_vertex_marker": "Cliccare quindi trascinare per spostare il simbolo",
- "modify_existing_vertex_measure": "Cliccare per eliminare il punto (2 punti min.)
Cliccare quindi trascinare per spostare il punto",
+ "modify_existing_vertex_measure": "Fare clic con il tasto destro del mouse per eliminare il punto (2 punti min.)
Cliccare quindi trascinare per spostare il punto",
"modify_icon_category_babs-v2-de_label": "Segni convenzionali civili",
"modify_icon_category_babs-v2-fr_label": "Segni convenzionali civili",
"modify_icon_category_babs-v2-it_label": "Segni convenzionali civili",
diff --git a/src/modules/i18n/locales/rm.json b/src/modules/i18n/locales/rm.json
index e2956bd9d..6a8e00de2 100644
--- a/src/modules/i18n/locales/rm.json
+++ b/src/modules/i18n/locales/rm.json
@@ -405,9 +405,9 @@
"modify_color_label": "Colur",
"modify_description": "Descripziun",
"modify_existing_vertex_annotation": "Spustar text :cliccar e trair",
- "modify_existing_vertex_linepolygon": "Cliccar per stizzar il punct (2 puncts minimum). Spustar punct :cliccar e trair",
+ "modify_existing_vertex_linepolygon": "Cliccar endretg per stizzar il punct (2 puncts minimum). Spustar punct :cliccar e trair",
"modify_existing_vertex_marker": "Spustar signalisaziun :cliccar e trair",
- "modify_existing_vertex_measure": "Cliccar per stizzar il punct (2 puncts minimum). Spustar punct :cliccar e trair",
+ "modify_existing_vertex_measure": "Cliccar endretg per stizzar il punct (2 puncts minimum). Spustar punct :cliccar e trair",
"modify_icon_category_babs-v2-de_label": "Zivile Signaturen",
"modify_icon_category_babs-v2-fr_label": "Zivile Signaturen",
"modify_icon_category_babs-v2-it_label": "Zivile Signaturen",
diff --git a/tests/cypress/support/commands.js b/tests/cypress/support/commands.js
index 1a33f72d8..0070a5f57 100644
--- a/tests/cypress/support/commands.js
+++ b/tests/cypress/support/commands.js
@@ -689,7 +689,7 @@ Cypress.Commands.add('writeStoreValue', (action, value) => {
// Reads a value from the window
Cypress.Commands.add('readWindowValue', (key) => {
- return cy.window().its(key)
+ return cy.window({ timeout: 15000 }).its(key)
})
// from https://github.com/cypress-io/cypress/issues/1123#issuecomment-672640129
diff --git a/tests/cypress/tests-e2e/drawing.cy.js b/tests/cypress/tests-e2e/drawing.cy.js
index 5f6091cf2..29e0916fd 100644
--- a/tests/cypress/tests-e2e/drawing.cy.js
+++ b/tests/cypress/tests-e2e/drawing.cy.js
@@ -250,7 +250,6 @@ describe('Drawing module tests', () => {
cy.wrap(offset[0]).should('be.lessThan', 0)
cy.wrap(offset[1]).should('be.lessThan', 0)
})
-
cy.wait('@update-kml')
.its('request')
.should((request) =>
@@ -262,8 +261,11 @@ describe('Drawing module tests', () => {
),
])
)
- cy.get('[data-cy="drawing-style-text-button"]').click()
+
+ cy.viewport(320, 600)
+ cy.get('[data-cy="close-popover-button"]').click()
cy.get('[data-cy="drawing-style-text-popup"]').should('not.exist')
+ cy.viewport(320, 568)
// changing/editing the description of this marker
const description = 'A description for this marker'
@@ -1447,6 +1449,7 @@ describe('Drawing module tests', () => {
cy.clickDrawingTool(EditableFeatureTypes.LINEPOLYGON)
cy.get('[data-cy="ol-map"]').click(100, 240)
cy.get('[data-cy="ol-map"]').click(150, 250)
+ cy.get('[data-cy="ol-map"]').click(190, 250)
cy.get('[data-cy="ol-map"]').dblclick(120, 270)
cy.wait('@profile')
@@ -1471,8 +1474,11 @@ describe('Drawing module tests', () => {
)
cy.get('[data-cy="profile-graph"]').trigger('mouseleave')
- cy.log('check that profile gets updated when feature is modified')
- cy.get('[data-cy="ol-map"]').click(150, 250)
+ cy.log('check that profile gets updated when feature is modified by removing a point')
+ // for mobile double click and on desktop right click
+ cy.get('[data-cy="ol-map"]').dblclick(190, 250)
+ cy.wait('@profile')
+ cy.get('[data-cy="ol-map"]').rightclick(150, 250)
cy.wait('@profile')
// clicking on the header of the profile container