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

Switch to WGS84 #53

Open
fidian opened this issue May 13, 2024 · 0 comments
Open

Switch to WGS84 #53

fidian opened this issue May 13, 2024 · 0 comments

Comments

@fidian
Copy link

fidian commented May 13, 2024

Browsers can report location data in WGS84 instead of NAD83. Using this standard, or allowing the converter to use this standard, would be great so coordinates don't need to be manipulated going into and out of this library.

I was able to work around this with the following code.

// By default, usng uses NAD83 but doesn't support WGS84. This is a workaround.
const converter = new (Converter as any)();
converter.ECC_SQUARED = 0.00669437999014;
converter.ECC_PRIME_SQUARED =
    converter.ECC_SQUARED / (1 - converter.ECC_SQUARED);
converter.E1 =
    (1 - Math.sqrt(1 - converter.ECC_SQUARED)) /
    (1 + Math.sqrt(1 - converter.ECC_SQUARED));
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

No branches or pull requests

1 participant