6

I have a map with a semi-transparent search bar on top of it. I have also got a bunch of markers with infowindow attached to them.

The problem is that google maps autopan feature obviously doesn't take my search bar into account, therefore if my marker is too close to the top, a part of the infowindow gets covered by the bar.

Is it possible to somehow specify the minimum distance the infowindow needs to be from the map's top?

I was also thinking of limiting the bounds of the map using markers' positions but in my case the markers can also end up under the search bar, so it is not an option.

Any ideas? Thank you for your time!

Kabachok
  • 573
  • 1
  • 7
  • 22
  • Are your infowindows all already open, or just in response to clicks on the markers? If the latter, do you autopan the map when you click on a marker? Maybe add some code to the question that demonstrates the problem. – duncan Jun 25 '21 at 08:26

1 Answers1

0

There exists a library called Snazzy Info Window that can be used instead of the usual InfoWindow. Then you can pass an option edgeOffset in pixels to this object and voila, problem solved. Hope this helps someone in the future!

Kabachok
  • 573
  • 1
  • 7
  • 22