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

Extend MeasureTool by angle tool #339

Merged
merged 3 commits into from
Jul 24, 2023
Merged

Conversation

chrismayer
Copy link
Collaborator

This extends the MeasureTool by a new functionality to measure/calculate an azimuth by drawing a 2-point line:

image

The function is hidden by default, so the MeasureTool looks as before in case anything is changed. To show / activate the functionality a new config property showAngleTool is introduced for the MeasureTool module. So by setting this property to true in the app-conf.json you'll see the new angle tool.

"wgu-measuretool": {
   "target": "toolbar",
   "win": "floating",
   "icon": "photo_size_select_small",
   "draggable": false,
   "strokeColor": "#c62828",
   "fillColor": "rgba(198,40,40,0.2)",
   "sketchStrokeColor": "rgba(198,40,40,0.8)",
   "sketchFillColor": "rgba(198,40,40,0.1)",
   "sketchVertexStrokeColor": "#c62828",
   "sketchVertexFillColor": "rgba(198,40,40,0.2)",
   "showAngleTool": true  <==
},

Extends the MeasureTool by a new functionality to measure an azimuth by
drawing a 2-point line.
Copy link
Collaborator

@JakobMiksch JakobMiksch left a comment

Choose a reason for hiding this comment

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

Code looks fine. Only minor remarks/ideas inline.

Comment on lines 12 to 14
* @param {Array<Number>} start The start coordinates of the line with the
* x-coordinate being at index `0` and y-coordinate being at index `1`.
* @param {Array<Number>} end The end coordinates of the line with the
Copy link
Collaborator

Choose a reason for hiding this comment

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

maybe here as type an OpenLayers coordinate can be used: https://openlayers.org/en/latest/apidoc/module-ol_coordinate.html#~Coordinate

Comment on lines 35 to 37
* @param {Array<Number>} start The start coordinates of the line with the
* x-coordinate being at index `0` and y-coordinate being at index `1`.
* @param {Array<Number>} end The end coordinates of the line with the
Copy link
Collaborator

Choose a reason for hiding this comment

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

maybe here as type an OpenLayers coordinate can be used: https://openlayers.org/en/latest/apidoc/module-ol_coordinate.html#~Coordinate

},
data () {
return {
area: ' -- ',
distance: ' -- '
distance: ' -- ',
Copy link
Collaborator

Choose a reason for hiding this comment

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

the string -- appears quite often and could be extracted to an constant. But that's more a matter of taste ...

Copy link
Collaborator

@JakobMiksch JakobMiksch left a comment

Choose a reason for hiding this comment

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

I did not run it. But the code looks fine. Can be merged from my side.

@chrismayer chrismayer merged commit e4275a8 into wegue-oss:master Jul 24, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants