I've been trying to solve this problem for a few days now. Hopefully
somebody can offer some insight.
I noticed this problem a while ago. The maps on my website which used
to work on every browser were now not working on IE7. I've tested the
code thouroughly and it works perfectly on Chrome, Firefox, and
interestingly enough IE 64 bit browsers - but it only loads a partial
map in IE7. There's a link here. Any help greatly appreciated!
You received this message because you are subscribed to the Google Groups
"Google Maps API" group.
To post to this group, send email to google-maps-api@googlegroups.com.
To unsubscribe from this group, send email to
google-maps-api+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/google-maps-api?hl=en.
> You received this message because you are subscribed to the Google Groups
> "Google Maps API" group.
> To post to this group, send email to google-maps-api@googlegroups.com.
> To unsubscribe from this group, send email to
> google-maps-api+unsubscribe@googlegroups.com.
> For more options, visit this group athttp://groups.google.com/group/google-maps-api?hl=en.
> I have noticed one thing though - If I click on maximize button for
> the window - when it refreshes it shows up in full.
This is the standard IE thing with not knowing the size of the map
when it's created because it's hidden. You can fix it by using the
{size:} option in the new GMap2(...) statement, or by including a
checkResize() command in the code which unhides it.
You've got whitespace in front of your <!DOCTYPE, that can invalidate
it on certain browsers.
The map is in a tab which is initially hidden. It fails the same in
IE6. The issue is just about a FAQ here ; when the API asks the
browser what size the (hidden) div is, the brower says zero. So the
map is built with zero size, and not all the needed tiles will be
fetched.
You've a choice of actions;
perform a checkResize() after un-hiding the map
or
tell the API what size map to build, in the GMap2 constructor
Don't you find it odd that IE 7 64bit version works fine? I'll try
implementing the checkResize() when the tab gets clicked and see how
that goes. As for the GMap2 constructor - This is what I use
var map = new GMap2(document.getElementById("map_canvas"),{size: new
GSize(599,487), mapTypes:[G_NORMAL_MAP,G_SATELLITE_MAP]});
does that not specify a size properly?
Funny thing is - 6 months ago it worked perfectly and I haven't
touched a thing!.....
On Nov 7, 1:07 pm, Rossko <ros...@culzean.clara.co.uk> wrote:
> You've got whitespace in front of your <!DOCTYPE, that can invalidate
> it on certain browsers.
> The map is in a tab which is initially hidden. It fails the same in
> IE6. The issue is just about a FAQ here ; when the API asks the
> browser what size the (hidden) div is, the brower says zero. So the
> map is built with zero size, and not all the needed tiles will be
> fetched.
> You've a choice of actions;
> perform a checkResize() after un-hiding the map
> or
> tell the API what size map to build, in the GMap2 constructor
On Nov 8, 6:29 pm, CaboDave <d...@suncabo.com> wrote:
> var map = new GMap2(document.getElementById("map_canvas"),{size: new
> GSize(599,487), mapTypes:[G_NORMAL_MAP,G_SATELLITE_MAP]});
> does that not specify a size properly?
Yes, it does, but you also have map.checkResize() in your initialize
function -- when the API does that, it asks the browser what size the
map is at that point. During initialisation, the map will have zero
size, and your {size} option gets reset.
I recommend removing that checkResize() line. If you want it in
somewhere, it needs to go wherever the tabs do something (is that
dtabs.js?) in order that it's done when the map is unhidden.
Yes - I was just testing it out to see if it might work in there. It was not
there before.
Ideally it needs to get called when someone clicks on the tab, but DTABS
doesn't offer that. I can add some javascript when some clicks on a tab, but
have yet to figure out how to display a tab from within that javascript...
life is just a series of hoops :-)
Dave
On Sun, Nov 8, 2009 at 11:06 AM, Andrew Leach <andrew.leac...@googlemail.com
> wrote:
> On Nov 8, 6:29 pm, CaboDave <d...@suncabo.com> wrote:
> > var map = new GMap2(document.getElementById("map_canvas"),{size: new
> > GSize(599,487), mapTypes:[G_NORMAL_MAP,G_SATELLITE_MAP]});
> > does that not specify a size properly?
> Yes, it does, but you also have map.checkResize() in your initialize
> function -- when the API does that, it asks the browser what size the
> map is at that point. During initialisation, the map will have zero
> size, and your {size} option gets reset.
> I recommend removing that checkResize() line. If you want it in
> somewhere, it needs to go wherever the tabs do something (is that
> dtabs.js?) in order that it's done when the map is unhidden.
> Andrew
> --
> You received this message because you are subscribed to the Google Groups
> "Google Maps API" group.
> To post to this group, send email to google-maps-api@googlegroups.com.
> To unsubscribe from this group, send email to
> google-maps-api+unsubscribe@googlegroups.com<google-maps-api%2Bunsubscribe@ googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/google-maps-api?hl=en.
> Yes - I was just testing it out to see if it might work in there. It was not
> there before.
> Ideally it needs to get called when someone clicks on the tab, but DTABS
> doesn't offer that. I can add some javascript when some clicks on a tab, but
> have yet to figure out how to display a tab from within that javascript...
> life is just a series of hoops :-)
> Dave
> On Sun, Nov 8, 2009 at 11:06 AM, Andrew Leach <andrew.leac...@googlemail.com
> > wrote:
> > On Nov 8, 6:29 pm, CaboDave <d...@suncabo.com> wrote:
> > > var map = new GMap2(document.getElementById("map_canvas"),{size: new
> > > GSize(599,487), mapTypes:[G_NORMAL_MAP,G_SATELLITE_MAP]});
> > > does that not specify a size properly?
> > Yes, it does, but you also have map.checkResize() in your initialize
> > function -- when the API does that, it asks the browser what size the
> > map is at that point. During initialisation, the map will have zero
> > size, and your {size} option gets reset.
> > I recommend removing that checkResize() line. If you want it in
> > somewhere, it needs to go wherever the tabs do something (is that
> > dtabs.js?) in order that it's done when the map is unhidden.
> > Andrew
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Google Maps API" group.
> > To post to this group, send email to google-maps-api@googlegroups.com.
> > To unsubscribe from this group, send email to
> > google-maps-api+unsubscribe@googlegroups.com<google-maps-api%2Bunsubscribe@ googlegroups.com>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/google-maps-api?hl=en.
> I did not write the js code and it looks like it is using a script
> called GPlotter 0.90. NO CHANGES were made to any of the javacript.
> I see the problem still exists on CaboDave's site, so does anyone have
> a fix or a clue?
The issue is that like all these problems the map is being initialized
before the DOM is defined enough so the API gets the correct size for
the map div. Move the call of init either to the body onload event
(so it doesn't get called until the page has completely rendered) or
move the call to the very end of the page (just before the </body>
tag).
> On Nov 8, 12:16 pm, David Girard <d...@suncabo.com> wrote:
> > Yes - I was just testing it out to see if it might work in there. It was not
> > there before.
> > Ideally it needs to get called when someone clicks on the tab, but DTABS
> > doesn't offer that. I can add some javascript when some clicks on a tab, but
> > have yet to figure out how to display a tab from within that javascript...
> > life is just a series of hoops :-)
> > Dave
> > On Sun, Nov 8, 2009 at 11:06 AM, Andrew Leach <andrew.leac...@googlemail.com
> > > wrote:
> > > On Nov 8, 6:29 pm, CaboDave <d...@suncabo.com> wrote:
> > > > var map = new GMap2(document.getElementById("map_canvas"),{size: new
> > > > GSize(599,487), mapTypes:[G_NORMAL_MAP,G_SATELLITE_MAP]});
> > > > does that not specify a size properly?
> > > Yes, it does, but you also have map.checkResize() in your initialize
> > > function -- when the API does that, it asks the browser what size the
> > > map is at that point. During initialisation, the map will have zero
> > > size, and your {size} option gets reset.
> > > I recommend removing that checkResize() line. If you want it in
> > > somewhere, it needs to go wherever the tabs do something (is that
> > > dtabs.js?) in order that it's done when the map is unhidden.
> > > Andrew
> > > --
> > > You received this message because you are subscribed to the Google Groups
> > > "Google Maps API" group.
> > > To post to this group, send email to google-maps-api@googlegroups.com.
> > > To unsubscribe from this group, send email to
> > > google-maps-api+unsubscribe@googlegroups.com<google-maps-api%2Bunsubscribe@ googlegroups.com>
> > > .
> > > For more options, visit this group at
> > >http://groups.google.com/group/google-maps-api?hl=en.
You received this message because you are subscribed to the Google Groups
"Google Maps API" group.
To post to this group, send email to google-maps-api@googlegroups.com.
To unsubscribe from this group, send email to
google-maps-api+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/google-maps-api?hl=.
> > I did not write the js code and it looks like it is using a script
> > called GPlotter 0.90. NO CHANGES were made to any of the javacript.
> > I see theproblemstill exists on CaboDave's site, so does anyone have
> > a fix or a clue?
> The issue is that like all these problems the map is being initialized
> before the DOM is defined enough so the API gets the correct size for
> the map div. Move the call of init either to the body onload event
> (so it doesn't get called until the page has completely rendered) or
> move the call to the very end of the page (just before the </body>
> tag).
> -- Larry
> > On Nov 8, 12:16 pm, David Girard <d...@suncabo.com> wrote:
> > > Yes - I was just testing it out to see if it might work in there. It was not
> > > there before.
> > > Ideally it needs to get called when someone clicks on the tab, but DTABS
> > > doesn't offer that. I can add some javascript when some clicks on a tab, but
> > > have yet to figure out how to display a tab from within that javascript...
> > > life is just a series of hoops :-)
> > > Dave
> > > On Sun, Nov 8, 2009 at 11:06 AM, Andrew Leach <andrew.leac...@googlemail.com
> > > > wrote:
> > > > On Nov 8, 6:29 pm, CaboDave <d...@suncabo.com> wrote:
> > > > > var map = new GMap2(document.getElementById("map_canvas"),{size: new
> > > > > GSize(599,487), mapTypes:[G_NORMAL_MAP,G_SATELLITE_MAP]});
> > > > > does that not specify a size properly?
> > > > Yes, it does, but you also have map.checkResize() in your initialize
> > > > function -- when the API does that, it asks the browser what size the
> > > > map is at that point. During initialisation, the map will have zero
> > > > size, and your {size} option gets reset.
> > > > I recommend removing that checkResize() line. If you want it in
> > > > somewhere, it needs to go wherever the tabs do something (is that
> > > > dtabs.js?) in order that it's done when the map is unhidden.
> > > > Andrew
> > > > --
> > > > You received this message because you are subscribed to the Google Groups
> > > > "Google Maps API" group.
> > > > To post to this group, send email to google-maps-api@googlegroups.com.
> > > > To unsubscribe from this group, send email to
> > > > google-maps-api+unsubscribe@googlegroups.com<google-maps-api%2Bunsubscribe@ googlegroups.com>
> > > > .
> > > > For more options, visit this group at
> > > >http://groups.google.com/group/google-maps-api?hl=en.