I believe I have found a decent workaround.
The problem seems to be something related to using "map.setUIToDefault
();"
when using map.setUIToDefault() we begin to get errors in IE6.
>From what i can tell these start to occur when the map size crosses
the threshold between a 'Large' map and 'Small' map to determine what
UI controls to use (Google defines A "small" map is one which is
smaller than 400 pixels wide or 300 pixels high. A "large" map is any
map 400x300 or larger.).
This affects people who hide the map using display: none see this
because it effectivly sets the map size to zero width and height. I
believe the reason it only shows up in IE because the way IE fires
resize events continuously as you move the mouse not after resizing
has stopped like firefox. Also IE fires resize events on the window
and on elements where firefox only fires on the window object.
You can demonstrate this by setting your original map width to '100%'
calling map.setUIToDefault() and then scale the browser window down to
a width smaller than 400 pixels in IE.
I've tried using map.checkResize() in several places but nothing seems
to be able to prevent the errors once they start if you choose to use
setUIToDefault().
The one thing that has worked for me is to manually construct my UI
options. see example code below.
//map.setUIToDefault(); <-- instead of this, use the following
var customUI = new GMapUIOptions();
customUI.maptypes = {};
customUI.zoom = {};
customUI.controls = {};
customUI.maptypes.normal = true;
customUI.maptypes.hybrid = true;
customUI.zoom.doubleclick = true;
customUI.zoom.scrollwheel = true;
customUI.controls.smallzoomcontrol3d = true;
customUI.controls.menumaptypecontrol = true;
map.setUI(customUI);
Using custom UI options i can resize or hide my map to my heart's
content and get no errors in IE or firefox.
You can find the available UI options here:
http://code.google.com/apis/maps/documentation/reference.html#GMapUIOptions.GMapUIOptions
Thomas K
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Maps API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/Google-Maps-API?hl=en
-~----------~----~----~----~------~----~------~--~---