Google v3 map info window opens outside the map

If the marker is clicked at the top of the map view, the infowindow is loaded outside the visible area, and the map must be dragged to see the contents of the infowindow.

Ideally, I do not want the card to be automatic. Is there a way to load the info window in the other direction, for example. if the marker is at the top of the viewport to display the infoindust in the downstream direction.

+6
source share
2 answers

Here is an example that used to be part of the Google Maps JavaScript API v3. Examples of code that switched to GitHub called: SmartInfoWindow . He does exactly what you describe. Check out the base code and this should make you go in the right direction.

+6
source

No, you cannot open google info windows by default in the other direction, since you are not implementing your own infowindow class. But you can disable auto-pannnig by simply passing TRUE to the disableAutoPan property of the InfoWindowOptions object, for example the documentation specified by a>.

+5
source

Source: https://habr.com/ru/post/911711/


All Articles