GMap is undefined in IE version 6.0.2800.1106.xpsp1.020828-1920
Hello.
I have a problem accessing a page that contains a Google Maps map. I
get a JavaScript error message stating: "'GMap' is undefined'. This
occurs when I try to instantiate a GMap:
var map;
var GM_map = document.getElementById("GM_map");
if(GM_map) {
map = new GMap(GM_map, [G_SATELLITE_TYPE, G_MAP_TYPE,
G_HYBRID_TYPE]);
map.addControl(new GLargeMapControl());
map.addControl(new GMapTypeControl());
map.centerAndZoom(new GPoint(-122.1419, 37.4419), 5);
GEvent.addListener(map, 'click', function(overlay, point) {
if (point) {
markerPoint = point;
}
});
}
The GM_map element is the div element that will show the map. I get the
error at the 4th line ("map = new GMap(GM_map, [G_SATELLITE_TYPE,
G_MAP_TYPE, G_HYBRID_TYPE]);").
This whole process works flawless in FireFox and Mozilla, but in IE
version 6.0.2800.1106.xpsp1.020828-1920 I get the error. I have read
many threads about this issue, but I was not able to find a solution.
I have tested the page on several computers using same version of IE
and none of them works. I even tested the "Hello World" of Google Maps
example and still got an error (yes, I did change the key :) and yes,
it worked fine in FireFox).
Nothing seems to work, except for one method:
1) I open IE and access my page - I get an error message
2) then I load (in the same window or in another IE window)
http://maps.google.com (that loads fine)
3) then I try to load my page again and SURPRISE!!! IT WORKS!!!
(this also works if I skip the first step)
If, after performing these steps, I close all IE windows, in order to
load again the page I have to redo the steps.
I thought of making a work-around for this to load maps.google.com in
background and only then load my site, but I was wondering if there is
a professional solution to this problem. Is it maybe a problem with
this version of IE, or maybe Windows SP1?
Thanx to all of you.
0 Comments:
Yorum Gönder
<< Home