-
Notifications
You must be signed in to change notification settings - Fork 302
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
refacto: migrate Crs to typescript #2436
Conversation
54c4243
to
54d3317
Compare
54d3317
to
b6e923f
Compare
06fa1e1
to
33c57e4
Compare
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.
Thanks :) Nice to see that we are moving forward on this migration 👍
While we're at it, I would be down for renaming some functions to make their name clearer:
toUnit
->getUnit
reasonnableEpsilon
->reasonableEpsilon
formatToEPSG
->formatToEpsg
(to be consistent with capital letters in other methods). Or use capitals in all methods with EPSG and TMS.
I would also make private is4326
.
Also, we could add a isDegreeUnit
since we expose a isMetricUnit
.
553960b
to
7d3138b
Compare
@jailln I fixed all issues listed in your review. I added an
Done, shall I mark it as breaking change though?
I chose to kept the old name since we'll surely remove it due to the reasons above.
|
7d3138b
to
ca2f245
Compare
Thanks for the changes :)
I would be clearer to only use the EPSG naming scheme yes.
I'm not sure it is used but we might add a breaking change to the commit message just in case. |
ca2f245
to
e275eac
Compare
Okay, I went a little bit further and removed the two naming schemes (which were not needed since #2412). This means that all I don't think they are used outside of the codebase IMO. As for the documentation, |
Thanks! that was a much needed cleaning :) Removing them like you did works for me.
Ok, thanks. |
BREAKING CHANGE: CRS.reasonnableEspsilon renamed to CRS.reasonableEpsilon
BREAKING CHANGE: CRS.toUnit renamed to CRS.getUnit
BREAKING CHANGE: CRS.isEPSG and CRS.isTMS have been removed BREAKING CHANGE: CRS.formatToESPG and CRS.formatToTMS have been removed
e275eac
to
61c99df
Compare
Added some breaking change notes in the commit messages. |
Description
This PR includes:
Crs
from javascript to typescriptProjectionLike
type alias for named CRS which could be later extended as either a string or aproj4
definition object (à la OpenLayer)Motivation and Context
As described in proposal #2396, we aim to gradually migrate our entire codebase (with the exception of deprecated modules) from javascript to typescript. We choose to start with modules with no-dependency and move up in the dependency tree.
This PR is the first step of Migrate geographic modules, migrating the base module
Crs
. Follow-up steps includes migration of dependent modulesCoordinates/Ellipsoid
andExtent
.