Skip to content

feat: add vector3ToLatLngAltitude conversion - #1260

Open
telmon95 wants to merge 1 commit into
googlemaps:mainfrom
telmon95:feat/vector3-to-latlng-altitude
Open

feat: add vector3ToLatLngAltitude conversion#1260
telmon95 wants to merge 1 commit into
googlemaps:mainfrom
telmon95:feat/vector3-to-latlng-altitude

Conversation

@telmon95

@telmon95 telmon95 commented Aug 11, 2026

Copy link
Copy Markdown

Summary

  • Adds vector3ToLatLngAltitudeRelative (inverse of latLngToVector3Relative) and ThreeJSOverlayView.vector3ToLatLngAltitude() (accounts for anchor + upAxis)
  • Includes round-trip unit tests using the NYC examples from the issue discussion
  • Documents the inverse API in the README and removes the stale latLngToVector3 import from the example

Fixes #887

Test plan

  • npm run lint
  • npm test (55 tests passing)
  • Confirm round-trip: overlay.vector3ToLatLngAltitude(overlay.latLngAltitudeToVector3(coords)) ≈ original coords for default and upAxis: "Y"
  • Spot-check against a map click listener near and far from the anchor

Add the inverse of latLngAltitudeToVector3 so world-space positions can be
converted back to WGS84 lat/lng/altitude, including upAxis handling.
@google-cla

google-cla Bot commented Aug 11, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

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

Successfully merging this pull request may close these issues.

Converting coordinates (Vector3 to latlngAltitude)

1 participant