-
Notifications
You must be signed in to change notification settings - Fork 937
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
Is there a better way to display InfoWindow? #333
Comments
After some messing around with it I arrived at this solution which I think will be more performant than the example. if the devs agree that this is better i can submit a pr for a new example a method in my map component:
First we control the visibility of the
then inside our
note the Lastly, in our
|
@brandonmp Also, 6.0.0 is released on npm beta tag now. We also have a new demo page. Feel free to try it: |
Hi @brandonmp, thank you for your example! I was able to use it and got my map to only show one InfoWindow at a time now. I do have the issue you mention about the InfowWindow being exactly on top of the Marker and I'm struggling to figure out how to use the pixelOffset with this library. I've imported the following at the top of my file:
and I've tried to add the options like this:
but I don't have access to google and can't figure out how to access the Size class as per Google's docs. I've also tried importing Feeling a bit stumped and any help would be very appreciated! |
Try use onClick inside html code , it work for me 💃
|
@alengel I have a load of markers on my map, which I also only wanted one info window to open at a time. To avoid multiple info windows, I decided not to have them as children of every marker; Rather a single As my `<Markers
Therefore to achieve the offset on an `<InfoWindow
I know this solution address's a now very old query, but I do hope that this will help someone else in future and save a lot of time! |
@cfdesign Thank you tremendously. I also encountered the 'google' not defined problem, and your answer saved me! |
looking at this example and a few things occur to me:
Immutable.js
and pass my marker locations down through props. obviously i can't mutate props, so according to the pattern in the example, I should create an intermediate array of markers betweenprops
andrender()
? This seems really counter intuitiveInfoWindow
, and dynamically tell it where to open)I was looking at instead using a
Popover
from the MUI library, but that requires aDOM Element
to determine the location it should open atI'm also looking at the Google Maps API, and it looks like you can pass
InfoWindow
map coordinates. this would work great, but how do I pass that info toInfoWindow
?The text was updated successfully, but these errors were encountered: