-
Notifications
You must be signed in to change notification settings - Fork 2
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
Feature/add measure tool #124
Conversation
- README has been added - CHANGELOG/package.json have been changed to alpha release
4304b17
to
9197c6c
Compare
Co-authored-by: Finn-Rasmus Darge <[email protected]>
9197c6c
to
17e61c2
Compare
Co-authored-by: Finn-Rasmus Darge <[email protected]>
…/add-measure-tool
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With 24e386b gone, there's no documented way on how to subscribe to or otherweise access measurements taken in the map left.
Co-authored-by: Dennis Sen <[email protected]>
Co-authored-by: Dennis Sen <[email protected]>
Co-authored-by: Dennis Sen <[email protected]>
Co-authored-by: Dennis Sen <[email protected]>
Co-authored-by: Dennis Sen <[email protected]>
Co-authored-by: Dennis Sen <[email protected]>
Co-authored-by: Dennis Sen <[email protected]>
A small issue when calculating the lengths still exists which will be tackled in the next commit.
I've added the information to the featureCollection cc8de51 However, I've encountered an error that stems from the way the draw interaction works and added a todo for that. If you got a lead on how to fix that, let me know. Otherwise, I'll get my thinking cap out 🎩 |
I don't see a simple solution without digging deeper into this. Have you seen the OL example? Maybe there's some indication on how it could be done in another way. (I also kinda like how much simpler the UI is, even though it has less information – do we need per-line measurements?) I've also noticed an additional bug where, if you draw e.g. a triangle, enter "Edit" mode, and pull from the last corner, a new side will exist that has no measurement on its own. |
After further digging it concluded that the issue exists because of the fix for modifying snapped features in I tested multiple different scenarios to change the underlying When checking how OpenLayers handles this, one example includes the same issue of not being able to un-snap features while another example fixes this by using a All in all, this outcome does not seem satifying whatsoever. However, I suggest that we go the route of the second example and use a I'd like to tackle this NOT as part of this PR as this issue is not new but only has become clear now. We'd also be able to merge #211. Edit: The measure issue has been fixed as well dbf946f |
See #124 (comment) for further information.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have found the following additional issues:
- Draw a line of multiple parts. Edit the line by pulling from the middle of line segments or pulling existing points. Sooner or later, no interaction indication is left on some of the fragments; any fragment (no matter if first/last/somewhere in the middle) may be affected. (I.e. the blue dot goes missing and that line segment is no longer editable.)
- The same thing can happen on polygons.
- I was able to "find" that line again on this polygon:
Note: That dot is the mouse interaction indicator. If clicked, the polygon is drastically altered. - Since 1km²=1000000m², values are miscalculated:
I also recommend using decimal places after larger units (km/ha) until values become larger, i.e. 2 decimal places may be used until 10km length are reached or something like that. I furthermore recommend to always give measurements in metres on the exported GeoJSON since that's a more parsable format. Or maybe that and the string, should it only be for display ... but parsing "1km²" versus "100ha" is annoying to distinguish.
@dopenguin According to plan you may change whatever you feel like before the merge. To my understanding, a follow-up PR will clean up the rest.
Summary
Added a measure tool for distances and areas
Instructions for local reproduction and review
npm run snowbox