Useful Google Maps Trick
By: conark
Published On: 1-10-2010
I found an issue in implementing Google Maps when you dynamically change the contents of a page around the map. For instance, let's say the map is, for whatever reason, hidden by default. The moment you show the content of the map, you'll notice that the part of the map will be damaged (it'll look grayed out). The issue is that you need to tell Google Maps to redraw itself. So let's say you have your map declared like this:
var map = new google.maps.Map2(document.getElementById("map"));
When you want the map to be shown, you need to run the following routine:
map.checkResize();
checkResize() will figure out how to redraw the map so you won't experience that awkward grayed out issue.
Post Comment
Trackbacks: (Trackback URL)
No Comments Posted Yet