Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: delete mode for geojson editable layers #136

Merged
merged 3 commits into from
Sep 17, 2024

Conversation

moharamfatema
Copy link
Contributor

Pull Request Description

Issue

There is currently no way to delete features from a FeatureCollection via user interaction.

Solution

Introduce a DeleteMode class that extends GeoJsonEditMode. This mode will:

  1. Handle user clicks to identify and remove the selected feature(s) from the FeatureCollection.
  2. Trigger an onEdit callback to update the collection in the application state.

Implementation

  • delete-mode.ts: Implement the DeleteMode class.
  • delete-mode.test.ts: Add unit tests to ensure correct functionality.

This will enable users to manage their data more effectively by removing unwanted features.

@moharamfatema moharamfatema changed the title add delete mode class and unit tests Feat: delete mode for geojson editable layers Sep 4, 2024
Copy link
Contributor

@ibgreen ibgreen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@moharamfatema Thanks for this contribution, I didn't even realize that we were missing this feature.

Please make a pass on the docs as well.

modules/editable-layers/src/edit-modes/delete-mode.ts Outdated Show resolved Hide resolved
@ibgreen
Copy link
Contributor

ibgreen commented Sep 4, 2024

@ibgreen ibgreen merged commit 0bdb5f0 into visgl:master Sep 17, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants