Skip to content
Snippets Groups Projects
Commit 60e3e36d authored by metourneau's avatar metourneau
Browse files

REDMINE_ISSUE-19720 | Amélioration du bouton de suppression sur la carte

parent 77d72793
No related branches found
No related tags found
No related merge requests found
......@@ -193,8 +193,6 @@ const editionService = {
* It assumes that there is only one feature present in the source.
*/
removeFeatureFromMap() {
// Reset all other tools to ensure only the delete feature functionality is active
this.resetAllTools();
// Access the source where the features are stored
const source = this.drawSource; // Replace with the correct reference to your OpenLayers source
// Get all features from the source
......@@ -202,6 +200,8 @@ const editionService = {
// Check if there is a feature to delete
if (features.length > 0 && confirm('Etes-vous sur de vouloir supprimer cet objet ?')) {
try {
// Reset all other tools to ensure only the delete feature functionality is active
this.resetAllTools();
// Remove the feature from the source
const featureToRemove = features[0];
source.removeFeature(featureToRemove);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment