Skip to content

InfoWindows are unable to overflow out of the GoogleMap component #744

Open

Description

@chesaman12

Description

When using the InfoWindow component, hovering over markers or advanced markers can leave the info window pop up to be partially cut off or all of the way hidden depending on the pan/zoom of the map. There is no way that I have found to custom style the markers or info window component to allow the info window to overflow/pop out of the GoolgleMap component. The z-index prop does not seem to effect his behavior either.

Steps to Reproduce

The easiest example to repro this on is https://visgl.github.io/react-google-maps/examples/advanced-marker-interaction.

  1. Load up an example with markers/advanced markers and an info window
  2. Pan the map around so that a marker is towards the very top of the map
  3. Click/hover the marker to make the info window popup
  4. Pan around the map to make the info window cutoff the screen/map

Image

Image

Environment

  • Library version: ~1.5.1
  • Google maps version: weekly
  • Browser and Version: Chrome Version 134.0.6998.178 (Official Build) (64-bit)
  • OS: Windows

Logs


Activity

  1. usefulthink commented on Apr 16, 2025

    @usefulthink
    Collaborator

    This is working as intended. The Map is the outer boundary for anything happening within the map.
    Besides this being implemented this way in the Google Maps API (so the only thing we could do would be to hack our way around it), I don't see an alternative that wouldn't cause problems for most use-cases.

  2. changed the title [-][Bug] InfoWindows are unable to overflow out of the GoogleMap component[/-] [+]InfoWindows are unable to overflow out of the GoogleMap component[/+] on Apr 16, 2025
  3. chesaman12 commented on Apr 16, 2025

    @chesaman12
    Author

    Do you have any idea's how I could accomplish this with react-dom createPortal? When I try to use it, it seems to be ignored.

  4. usefulthink commented on Apr 17, 2025

    @usefulthink
    Collaborator

    You can't use the built-in components to do this, since all of them will render within the DOM context of the map (and the main container that has overflow:hidden, iirc).

    Essentially, you could use the google.maps.OverlayView class to get screen coordinates for a given geographic location, then use that to position your own html elements within the page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions