-
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
feat: distance measurement for line strings #1308
base: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for eoxelements ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
…lements into map/feature/area-measurements
measure
attribute line strings
measure
attribute line stringsmeasure
attribute and line strings
measure
attribute and line stringsmeasure
attribute and line strings
measure
attribute and line stringsmeasure
attribute and line strings
measure
attribute and line stringsThere 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.
The way it is currently set up would mean we could add this rather as a functionality to eox-map
, instead of eox-drawtools
, right? Seeing that there is no logic in the drawtools itswelf (besides the overlay clearing)
elements/map/src/helpers/draw.js
Outdated
* @param {Polygon} polygon The polygon. | ||
* @return {string} Formatted area. | ||
*/ | ||
const _formatArea = function (polygon) { |
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.
Is this used anywhere? It would be nice to support both lenght as well as area measurement.
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.
Yes, as currently implemented we would add it as a feature of the map, since that is where the OL interaction is created.
Currently this is not used, since the goal is mostly to determine distances in the GTIF apps. Question with two-dimensional measurements is also how the tooltip should behave (properly centered or stationary in a corner of the map).
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.
We should reconsider if this makes sense this way, as it implements a functionality in the eox-map but "sells" it as drawtools-functionality. Also, I'd suggest we either only support line strings and remove the code regarding area measurement, or we also support area measurement. Plus hopefully we find a way to test the new functionalities...
Implemented changes
Enables the map and draw tools to display a geographically accurate distance measurement on the surface of Earth for lines drawn by the user.
Two conditions must be fulfilled in order for the measuring tooltip to appear:
<eox-drawtools measure>
)LineString
.As long as these are configured, the measuring tooltip should show up automatically, as can be seen in the Distance Measurement story in the Draw Tools.
Due to a large increase in complexity regarding the tooltip alignment, area measurements will not be implemented for now, even if the calculation works fine. If desired, that will follow in another PR.
Screenshots/Videos
Checklist before requesting a review