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

Add capability to draw new polygon and linestring geoms #2082

Merged
merged 5 commits into from
Jan 13, 2025

Conversation

spwoodcock
Copy link
Member

@spwoodcock spwoodcock commented Jan 10, 2025

What type of PR is this? (check all applicable)

  • πŸ• Feature
  • πŸ› Bug Fix
  • πŸ“ Documentation
  • πŸ§‘β€πŸ’» Refactor
  • βœ… Test
  • πŸ€– Build or CI
  • ❓ Other (please specify)

Related Issue

Related to #1979

Describe this PR

  • We should be able to collect new polygon and linestring geoms with this update.
  • By default all new projects are type 'polygon' / 'geoshape'.
  • The type of geometry to draw needs to be configured at project creation.
  • Setting the new_geom_type param will also modify the XLSForm as needed to the correct geometry type.

Future todo:

  • Add field / selection to project creation workflow in frontend.
  • Work out why the polygon drawing is a bit flaky:
    • They seem to complete on the third vertice being drawn.
    • It's possible to draw more by holding the click, dragging the map slightly, then releasing the click.
    • Probably some conflict with the default MapLibre click handler?
  • Note that I didn't add any extra toolbar buttons to the map. It's not possible to edit verticies, as this is probably done on a phone and that would be too fiddly. The user will just have to create a new geom if they make a mistake.

Screenshots

image

Review Guide

  • Create a new project.
  • Create new polygons.
  • Test they work in ODK Collect.

Checklist before requesting a review

[optional] What gif best describes this PR or how it makes you feel?

@spwoodcock spwoodcock self-assigned this Jan 10, 2025
@github-actions github-actions bot added enhancement New feature or request frontend Related to frontend code backend Related to backend code labels Jan 10, 2025
Copy link
Collaborator

@Anuj-Gupta4 Anuj-Gupta4 left a comment

Choose a reason for hiding this comment

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

I tested this locally using odk collect in mobile phone.
It works exactly as expected for new polygons. I didn't see any way to create new linestrings yet.
Approving for polygons only.

@Sujanadh Sujanadh requested a review from NSUWAL123 January 13, 2025 07:30
@spwoodcock spwoodcock merged commit 402dd8f into development Jan 13, 2025
9 checks passed
@spwoodcock spwoodcock deleted the feat/polygon-line-point-new-geoms branch January 13, 2025 15:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Related to backend code enhancement New feature or request frontend Related to frontend code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants