RE: Google Maps API Thickbox

Home

Google Maps API + Thickbox

Jan82008
Recommended / related

Had some trouble for a while at work with getting our google maps working with this thickbox, and I put it off for ages (telling people not to put a map in a lightbox), but today I got to the bottom of it. Don't load your map until the lightbox has loaded, by setting a timeout, like:

setTimeout( function() {
var map = new GMap2( $('#map' ));
map.setCenter( new GLatLng( 0, 0 ), 0 );
var bounds = new GLatLngBounds();
.
.
.
}, 0.1 );


It's not exactly been bugging me for ages, but it was bugging me ages ago, and then I forgot about it. Now it's fixed! Bit of a dirty hack really.

Where'd everybody go?

:: Comment / reply

RE: Google Maps API + Thickbox

Hi,
Could you show me exactly how to set the time out with this function ?

function load() {
if (GBrowserIsCompatible()) {
map = new GMap2(document.getElementById("map"));
map.setCenter(new GLatLng(40.967715,-76.887817), 7);
map.addControl(new GLargeMapControl());
......

Thanks

:: 23 Oct :: :: Comment / reply

RE: Google Maps API + Thickbox

There are a couple of ways, either put it within function load():

function load() {
if (GBrowserIsCompatible()) {
setTimeout( function() {
map = new GMap2(document.getElementById("map"));
map.setCenter(new GLatLng(40.967715,-76.887817), 7);
map.addControl(new GLargeMapControl());
......
}, 0.1 );
}
}


or wrap it around the place where you call function load()

24 Oct :: :: Comment / reply

RE: Google Maps API + Thickbox

I tried this fix for loading a google map in a thickbox window. It works on Safari and FF (mac) and FF (PC). But IE and Opera (PC & MAC) still don't work. Does anyone have any ideas?

You can see my example here:
http://www.davidcool.com/gallery_view.php?CID=7&SCID=105&AID=1&IMGID=1418#tanchor1418

Just click on the "map" icon.

Thanks,
David

:: 8 Nov :: :: Comment / reply

Paul Clarke's blog - I live and work near Folkestone. Married to Clare and father to Harry, I am a web dev, and I like javascript, PHP, Folkestone Gerald, pubs, restaurants, history, genealogy, TV, music, popbitch, squirrels, pirates ☠, time travel, stained glass...

Also from the same week

Some more posts from the same week as .

A new dawn, a new hope, a new America, etc [Wednesday 5 November 2008]

Non political news [Wednesday 5 November 2008]

RE: Who is Deanne Berry? [Wednesday 5 November 2008]

I fought the law, and the post office won [Saturday 8 November 2008]

Cure tickets [Saturday 8 November 2008]

RE: Google Maps API + Thickbox [Saturday 8 November 2008]

A mighty wind [Sunday 9 November 2008]

If you google for Kaddy Lee-Preston [Sunday 9 November 2008]

Cure tickets on sale at 9am [Monday 10 November 2008]

NME Big Gig 2009 / The Cure support acts Support from Franz Ferdinand, Crystal Castles, and White Lies looks like. Still got tickets here! [Monday 10 November 2008]

Deanne Berry [Sunday 20 March 2005]

Who is Deanne Berry? [Tuesday 22 March 2005]

RE: Deanne Berry [Sunday 20 March 2005]

Google Maps API + Thickbox [Tuesday 8 January 2008]

RE: Google Maps API + Thickbox [Thursday 23 October 2008]

RE: Google Maps API + Thickbox [Friday 24 October 2008]