-
Notifications
You must be signed in to change notification settings - Fork 205
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
The special characters cause it to fail in Chrome. #80
Comments
Oh, wait a second! The This is the transformed code that I see in devtools: // x = (ν+h)⋅cosφ⋅cosλ, y = (ν+h)⋅cosφ⋅sinλ, z = (ν⋅(1-e²)+h)⋅sinφ
// where ν = a/√(1−e²⋅sinφ⋅sinφ), e² = (a²-b²)/a² or (better conditioned) 2⋅f-f²
const ellipsoid = this.datum
? this.datum.ellipsoid
: this.referenceFrame ? this.referenceFrame.ellipsoid : ellipsoids.WGS84;
const φ = this.lat.toRadians();
const λ = this.lon.toRadians();
const h = this.height;
const { a, f } = ellipsoid;
const sinφ = Math.sin(φ), cosφ = Math.cos(φ);
const sinλ = Math.sin(λ), cosλ = Math.cos(λ);
const eSq = 2*f - f*f; // 1st eccentricity squared ≡ (a²-b²)/a²
const ν = a / Math.sqrt(1 - eSq*sinφ*sinφ); // radius of curvature in prime vertical
const x = (ν+h) * cosφ * cosλ;
const y = (ν+h) * cosφ * sinλ;
const z = (ν*(1-eSq)+h) * sinφ;
return new Cartesian(x, y, z); |
Aha! I was able to solve the problem by specifying the charset on my script tag: <script src="./entry.js" charset="utf-8"></script> I didn't need this before, but now that the characters are present, that made it work. EDIT: a better way, for the whole HTML file: <html>
<head>
<meta charset="utf8" />
</head>
<body>
<script src="./entry.js"></script>
</body>
</html> |
I'm unable to run the code, because if I run something like
Google Chrome (actually Electron) says:
It seems the characters
φ
are breaking it.Would you mind using regular characters?
The text was updated successfully, but these errors were encountered: