Google Map Gotchas
I have been doing some work with Google Maps and found an informative website that helped solve some problems. My first problem was that the info window displayed above my marker was too big, with a lot of extra space at the bottom. It turns out, the info box is created by Google’s javascript based on how large it thinks the text is. Cascading styles, such as those applied to a container div, are not rendered on the text until the size of the info window has already been calculated. You can wrap the content in the info window with a span or div and re-apply the styles (really only size / padding / margin would make much of a difference) to that div/span and the extra space disappears.
The other issue I ran into was how to get the overview map, which appears on the lower right hand side. The GOverviewMapControl is does the trick, and I couldn’t find any reference to it in the Google Maps class reference. You can set the size by passing a GSize object in the constructor.
var map = new GMap2(document.getElementById(”map”));
map.addControl(new GOverviewMapControl(new GSize(200,200)));