react-google-maps icon indicating copy to clipboard operation
react-google-maps copied to clipboard

[Bug]info windows for transit directions not styled correctly

Open jackiepapers opened this issue 1 year ago • 5 comments

Description

When rendering a transit directions route, the info windows for each leg segment have a strange styling. Screenshot 2024-11-01 at 3 06 16 AM

Steps to Reproduce

Using the example code

Environment

  • Library version: @vis.gl/[email protected]
  • Google maps version: weekly
  • Browser and Version: Chrome 130.0.6723.70
  • OS: macOS Sonoma

Logs

No response

jackiepapers avatar Nov 01 '24 10:11 jackiepapers

Can you share a link to the example you are referring to?

usefulthink avatar Nov 01 '24 10:11 usefulthink

I mean the example code provided but just change the mode to TRANSIT https://github.com/visgl/react-google-maps/tree/main/examples/directions

jackiepapers avatar Nov 01 '24 10:11 jackiepapers

I did that, and this is what it looks like for me:

image

So I can't see the problem you’re seeing there. You could check with the devtools to see if there is any CSS from the site interfering with those info-windows. However, besides that there isn't a lot we can do about it, since all of the rendering is happening inside the DirectionsRenderer.\

Maybe we need to open an issue in the Google Maps Issue Tracker about this.

usefulthink avatar Nov 01 '24 11:11 usefulthink

I am using it in Next js. It seems there's an image that's styled with absolute and top: 19px. If I remove the top: 19px it looks right. <img alt="" src="https://maps.gstatic.com/mapfiles/tiph.png" draggable="false" style="user-select: none; border: 0px; padding: 0px; margin: 0px; position: absolute; right: -8px; top: 19px; width: 15px; height: 9px;" class="">

jackiepapers avatar Nov 01 '24 12:11 jackiepapers

That's what I thought. But since we can't change how Google Maps renders these icon overlays, you can check which CSS rules from your application affect that image and remove them.

usefulthink avatar Nov 21 '24 16:11 usefulthink