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

Render points on both frontends, with colour determined by status #2174

Merged
merged 5 commits into from
Feb 12, 2025

Conversation

spwoodcock
Copy link
Member

@spwoodcock spwoodcock commented Feb 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

Fixes #2164
Related to #2154

Describe this PR

  • We have so far mostly worked with polygons.
  • Somewhere along the way we forgot about points and linestrings - not a high priority, but should also work at some point.
  • This PR goes part way to solving Ensure mapping workflow works well for points (in addition to polygons)Β #2154, by displaying the points on the project details page and mapper frontend.
  • The colour of the point is determined by the status.
  • For the React frontend I simply add shading over the same icon - it doesn't look that great.
  • For the Svelte frontend I created separate coloured icons that render separately.

Screenshots

Mapper (svelte) frontend:

image
the colours don't match the legend exactly, but it's a good start

Management (react) frontend:

image
the colours are less obvious here, as its shading the same icon

Review Guide

  • Create a project with points to map.
  • Map as usual and see the points change colour.

Checklist before requesting a review

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

@spwoodcock spwoodcock requested a review from NSUWAL123 February 10, 2025 22:27
@spwoodcock spwoodcock self-assigned this Feb 10, 2025
@github-actions github-actions bot added enhancement New feature or request frontend Related to frontend code labels Feb 10, 2025
@spwoodcock
Copy link
Member Author

Damn, this also causes the symbol to render on top of polygons for buildings too...

image

We need a conditional render of EITHER symbol point OR filled polygon.

For now we could do this via the new_geom_type field? If so, perhaps we rename this to primary_geom_type in future, and only allow mapping of a specific geometry type per project (additional datasets can be added in different geom type though)

@spwoodcock
Copy link
Member Author

Fixed the issue above. Also made it so the project type is set automatically, based on he predominant geometry type uploaded.

But I have a feeling center of the icon is where the actual point is located, when we need an offset to make it the bottom of the pin πŸ˜…

@spwoodcock spwoodcock merged commit ceb31a3 into development Feb 12, 2025
9 checks passed
@spwoodcock spwoodcock deleted the feat/point-project-details branch February 12, 2025 16:42
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.

Points as map features are not visible on project details page
2 participants