Centering an infowindow and infowindow margins - Google Maps - google-maps

I'm running into a little problem with my infowindows: when a marker
is close enough to the edge of the map that the map needs to pan to
display the full infowindow, it does so but not enough to allow for a
few pixels of space between the infowindow and the border of the map.
Technically this works because content is made visible but it looks
awful.
Any ideas on how to make the infowindow have a margin?
marker = new GMarker(new GLatLng(this.latitude,this.longitude));
map.addOverlay(marker);
marker.openInfoWindow(this.infoWindow());
But this shows correctly if I use
map.openInfoWindow(marker.getLatLng(),this.infoWindow());
Now how can I make the infowindow anchor starts from top of the Marker not from bottom?

This happens automatically in google maps so it looks like a CSS problem to me. Are you sure that there is nothing placed over the left side of the map?

Related

Google maps infowindow autopan: is it possible to customize the distance to the map's top?

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!
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!

Position Google Maps InfoWindow to the right corner

Instead of the default position above the marker , I want the InfoWindow to be open to the top right corner of the map . How to do that ?
Infowindows may be attached to either a marker object or on the map itself at a sepcified lat,lng. That being said, if you allow users to pan your map, there isn't a good way to put the infowindow at the top-right corner of the map. You can only anchor it to a marker or specific lat,lng. Moving the map will move the infowindow whether it is anchored to a marker or a lat,lng.
One possible thing you could do as a workaround is use custom controls as documented here:
https://developers.google.com/maps/documentation/javascript/controls#CustomControls
You can put these custom controls at the top-right corner of the map. Depending on what you were wanting the infowindow to have inside of it, you may be able to use the custom controls in the link above to accomplish what you need. The custom controls are really intended for user interaction, but if you need to have an info-window at the top-right of your map to display information, I believe this would be a good workaround.
I hope this helps!

How can I display an InfoWindow beyond the edge of a Google Map and not pan the map?

I'm using google maps api v3.
I'm displaying InfoWindow,and we know that unless auto-pan is disabled, an InfoWindow will pan the map to make itself visible when it is opened.
But i want to make the infowindow is fully visible when it opens with out pan the map,like intelligently switch the position and dimensions of the InfoWindow depending on where the edge is.
Maybe some would suggest smartinfowindow, but there is some problems with smartinfowindow,you can test it.
Is there any other way?
Thank you very much!

infoWindow that fills up map

Does anyone know how to create a custom Google Maps infoWindow That will just open and fill over the map completely, instead of paning the map and setting the bubble over the marker? Basically, what I'd like to do is have my markers on the map, then when a user clicks on a marker, it just opens the content in a panel that fits the entire map itself. I looked at the options mentioned here: link but none of these seem to do what I'd like, they still open a "bubble" type of window. Has anyone done this or can someone point me in the right direction?
Creating your custom info window is not so difficult, but it's a little bit complicated.
If you want to find the easiest way, I recommend InfoBubble library.
http://google-maps-utility-library-v3.googlecode.com/svn/trunk/infobubble/examples/example.html
If you want to just prevent map panning when the infoWindow open, you can specify an option:
var infoWnd = new google.maps.InfoWindow({
disableAutoPan : true
});

Google Maps - Infobox API - scroll pane vs change position

Using Google Maps InfoBox -
http://google-maps-utility-library-v3.googlecode.com/svn/trunk/infobox/docs/reference.html
Currently the map will scroll - pan control - when your infobox is outside of the bounds of the map.
I'm looking for a way to detect if the infobox will be outside of the bounds of the map, and if so the position is switched (currently I have the infoBoxAnchor set at 9,2) - so set the infoboxanchor in the opposite x direction.
Anyone done anything like this?
Thanks.
Could be tricky - infowindows are dynamically sized based on the content in them. What you could do, is in the InfoWindowOptions, set disableAutoPan=true. This will prevent the map panning to display the infowindow. Then I'm guessing you could use jQuery (or any other JS you like) to figure out:
the size of the infowindow based on the position where it's anchored to on the map,
is the entire infowindow visible
if not, move the infowindow's position
Related:
Auto adjustment of InfoWindow position on Google Maps
Google Maps Mashup with Intelligently positioning InfoBox
Google Maps: How to prevent InfoWindow from shifting the map
And a possible solution (thanks to above links) at http://gmaps-samples-v3.googlecode.com/svn/trunk/smartinfowindow/smartinfowindow.html