On 25 July 2011 16:36, Rossko <[email protected]> wrote:
> You probably need to wait for the browser to render your div before
> trying to initialise the map. Different browsers do things at
> different times.
But there's also this issue:
>>>
Line: 54
Char: 7
Object doesn't support this property or method.
In the code below (which is in my page header), the error is triggered
by the line:
map = new google.maps.Map2(document.getElementById("map"));
<<<
which is caused by IE's habit of automatically assigning variables to
elements of the same name. In IE, "map" **already** refers to the map
element, so it won't let you reassign it.
The solution is to use the var keyword. Using that is always good
practice anyway as it defines the scope of the variable:
var map = new google.maps.Map2(document.getElementById("map"));
--
You received this message because you are subscribed to the Google Groups
"Google Maps API V2" 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.