-
Notifications
You must be signed in to change notification settings - Fork 182
feat: add 3D map, marker and popover components #898
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
Draft
mrMetalWood
wants to merge
24
commits into
visgl:main
Choose a base branch
from
mrMetalWood:feat/3d-map-components
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Adds support for the 'anchorLeft' and 'anchorTop' properties on the AdvancedMarker component. This provides a more direct way to control the anchor point of the marker, especially with modern versions of the Google Maps JavaScript API. The implementation includes: - A new internal 'useAdvancedMarkerAnchorPoint' hook to encapsulate anchoring logic. - Version detection to use native 'anchorLeft'/'anchorTop' properties on Google Maps API v3.62+ and fallback to a CSS transform on older versions. - A warning is logged when using the new props on unsupported API versions. - Added TypeScript definitions of anchor options to type augmentation - Added API documentation.
Adds a suite of tests for the anchor-related props ('anchorLeft', 'anchorTop', and 'anchorPoint') on the AdvancedMarker component.
This suite covers:
- Precedence of 'anchorLeft'/'anchorTop' over 'anchorPoint' on modern APIs.
- Correct fallback to 'anchorPoint' on modern APIs.
- Correct application of 'anchorPoint' via CSS transform on legacy APIs.
- Warning generation when using modern props on legacy APIs.
- Snapshot testing for console warnings.
Marks the 'anchorPoint' prop as deprecated in favor of the 'anchorLeft' and 'anchorTop' props. - Adds a '@deprecated' JSDoc tag to the 'anchorPoint' prop. - Adds a TODO comment to add a console warning in a future version.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds React components for Google Maps 3D API support, enabling developers to create 3D map experiences.
Key Components
<Map3D>- Main 3D map component with controlled/uncontrolled camera props<Marker3D>- 3D markers with altitude support<Popover3D>- Popovers/Infowindows positioned in 3D spaceKey Features
center,range,heading,tilt,roll(controlled via props ordefaultXvariants)flyCameraAround(),flyCameraTo(), andstopCameraAnimation()via refonCameraChanged,onClick,onSteadyChangecallbacksuseMap3D(id?)to access Map3D instances from child components