-
Notifications
You must be signed in to change notification settings - Fork 3
feat: distance measurement for line strings #1308
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
Draft
spectrachrome
wants to merge
35
commits into
main
Choose a base branch
from
map/feature/area-measurements
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 19 commits
Commits
Show all changes
35 commits
Select commit
Hold shift + click to select a range
b33c0b0
chore: implement very simple area measurement in drawstart handler
spectrachrome 7c4f058
wip: try calculating circumference
spectrachrome d4d87dd
wip: use getLength method to calculate distances
spectrachrome 24c44df
feat: properly implement area measurement with correct distances
spectrachrome d12d50e
fix: make sure overlays are cleaned up properly
spectrachrome 8290727
feat: simplify calculation and provide area for polygons
spectrachrome 66356ba
Merge branch 'main' into map/feature/area-measurements
spectrachrome c4eb290
fix: merge conflict
spectrachrome ed16f3f
chore: remove unnecessary method
spectrachrome 241c41c
fix: only clear map overlays if applicable
spectrachrome b8932b9
chore: formatting
spectrachrome 555a0c4
chore: add a `measure` attribute to map
spectrachrome e5b4ede
fix: a number of display issues, migrate to line string only
spectrachrome 1bc5e09
feat: create a story for distance measurements
spectrachrome a4f5268
fix: linter errors
spectrachrome b44ea98
Merge branch 'main' into map/feature/area-measurements
spectrachrome 5b6efad
chore: run prettier
spectrachrome 51ca165
Merge branch 'map/feature/area-measurements' of github.com:EOX-A/EOxE…
spectrachrome 0614d89
doc: update comments
spectrachrome 389ebff
feat: define measure attribute on draw tools
spectrachrome 90407ad
chore: move measuring from map into draw tools
spectrachrome a1acaa5
chore: remove old imports
spectrachrome cf617ad
chore: run prettier
spectrachrome 43555b4
fix: merge conflicts
spectrachrome 615589d
fix: linter issues, add more doc comments
spectrachrome ba9a55f
chore: provide single default export in measure helper
spectrachrome a3580d7
chore: cleanup
spectrachrome 18a71eb
chore: run prettier (again?)
spectrachrome 658516f
chore: replace mock-map reference
spectrachrome 9c1c014
temp: work on tests
spectrachrome f9bc7fe
chore: add play function to fail e2e test deliberately
spectrachrome 68014bc
chore: remove cypress file in favor of play fn test
spectrachrome ceae29c
Merge branch 'main' into map/feature/area-measurements
spectrachrome 651442a
fix: linter errors and format
spectrachrome 58ca335
chore: remove play function
spectrachrome File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| import { html } from "lit"; | ||
| import { STORIES_MAP_STYLE, STORIES_LAYERS_ARRAY } from "../src/enums"; | ||
|
|
||
| /** | ||
| * Component demonstrating how EOxMap and the draw tools can be used to measure distances on a map. | ||
| */ | ||
| export const DistanceMeasurement = { | ||
| render: () => html` | ||
| <eox-map | ||
| id="line-measurement" | ||
| style=${STORIES_MAP_STYLE} | ||
| .layers=${STORIES_LAYERS_ARRAY} | ||
| measure | ||
| /> | ||
| <eox-drawtools | ||
| for="eox-map#line-measurement" | ||
| multiple-features | ||
| allow-modify | ||
| type="LineString" | ||
| /> | ||
| `, | ||
| }; | ||
|
|
||
| export default DistanceMeasurement; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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).