-
Notifications
You must be signed in to change notification settings - Fork 42
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
Conversation
Extends the MeasureTool by a new functionality to measure an azimuth by drawing a 2-point line.
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.
Code looks fine. Only minor remarks/ideas inline.
src/util/Angle.js
Outdated
* @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 |
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.
maybe here as type an OpenLayers coordinate can be used: https://openlayers.org/en/latest/apidoc/module-ol_coordinate.html#~Coordinate
src/util/Angle.js
Outdated
* @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 |
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.
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: ' -- ', |
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.
the string --
appears quite often and could be extracted to an constant. But that's more a matter of taste ...
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 did not run it. But the code looks fine. Can be merged from my side.
This extends the
MeasureTool
by a new functionality to measure/calculate an azimuth by drawing a 2-point line: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 propertyshowAngleTool
is introduced for theMeasureTool
module. So by setting this property totrue
in theapp-conf.json
you'll see the new angle tool.