-
Notifications
You must be signed in to change notification settings - Fork 22
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
Upgrade ol5 #8
Upgrade ol5 #8
Conversation
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.
Nice work @dnlkoch
Just a minor question regarding test of MeasureUtil
src/MeasureUtil/MeasureUtil.spec.js
Outdated
@@ -38,8 +38,8 @@ describe('MeasureUtil', () => { | |||
const expectedShortLength = MeasureUtil.getLength(shortLine, map); | |||
const expectedLongLength = MeasureUtil.getLength(longLine, map); | |||
|
|||
expect(expectedShortLength).toEqual(99.99999999669033); | |||
expect(expectedLongLength).toEqual(100545.83533277796); | |||
expect(expectedShortLength).toEqual(99.88824008937313); |
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.
Why did these values change?
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.
Also, floats/doubles should not be checked for equality, but compared using a delta (0.1 + 0.2 !== 0.3
).
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 default sphere radius taken into account for length/area calculation in ol
is set to 6371008.8 whereas the previous implementation in ol-util
used the non-default value 6378137 (that is the value equal to the semi-major axis of the WGS84 ellipsoid).
If needed the value may be passed to the corresponding util methods, but in here I would like to make use of the same radius as used in ol per default.
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.
@hwbllmnn Yes, absolutely! Fixed (and will be fixed for all other occurrences in a separate PR).
This updates the
ol-util
classes to make use of the current version ofol
(5.1.3).In addition eslint is added.