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

[Feat] Close button component in info window #446

Open
fschroiff opened this issue Jul 10, 2024 · 3 comments
Open

[Feat] Close button component in info window #446

fschroiff opened this issue Jul 10, 2024 · 3 comments

Comments

@fschroiff
Copy link

Target Use Case

I'd like to be able to translate and style the close button.

Proposal

Maybe a prop on the InfoWindow component where I could add a new component for the button?

@usefulthink
Copy link
Collaborator

usefulthink commented Jul 10, 2024

This is available: when using the Maps JavaScript API beta-version, you can set headerDisabled={true} on the InfoWindow component and provide your own content including a close button. (see https://visgl.github.io/react-google-maps/docs/api-reference/components/info-window#headerdisabled-boolean)

@fschroiff
Copy link
Author

I'm not sure what kind of ramifications using a "beta" version of the API in a production environment has...

@usefulthink
Copy link
Collaborator

Understood. But without those API features there's very little we can do. You could probably add some styles to hide the default close-button and add your own in the content, but that's not officially supported (however, I think the gm-style-iw classes on the DOM-elements created by the maps API haven't changed in years).
Another alternative would be to use the AdvancedMarker component to create a custom info window.

I would expect these features to be promoted to generally available in a month or two, I can try to get a more definitive answer on that.

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

2 participants