Hi
I've modifed the javascript that creates the map variable like this:
Changed
if (GBrowserIsCompatible()) {
var map = new GMap2(document.getElementById("map"));
to
if (GBrowserIsCompatible()) {
map = new GMap2(document.getElementById("map"));
Because I wanted the map to be accessible to other Javascript
functions in the header outside of gload()
The problem is that
map = new GMap2(document.getElementById("map"));
gives me the JavaScript error
Object doesn't support this property or method
in IE 8.
How can I access the map variable from another javascript function in
a way that will keep IE 8 happy? For example, I have a function I use
for sideclicks which I can only seem to call outside of gload():
function sideclick(lat,lng){
var point = new GLatLng(parseFloat(lat),parseFloat(lng));
map.setCenter(point);
map.setZoom(14);
for (var i=0; i<gmarkers.length; i++) {
if(gmarkers[i].getLatLng().equals(point)){
GEvent.trigger(gmarkers[i], 'click');
}
}
}
If you need to see this in action the page is
http://www.taranaki.info/visit/theme.php/id/206
(it'll break in IE8)
Any tips from JavaScript gurus would be appreciated :)
Cheers
Lucas
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---