Blog2008 ≫ Google Maps API + Thickbox

Had some trouble for a while at work with getting our google maps working with this12, 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](/wiki/#map) = new GMap2( $('#map' ));
  [map](/wiki/#map).setCenter( new GLatLng( 0, 0 ), 0 );
  var bounds = new GLatLngBounds();
  .
  .
  .
}, 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?

💬 RE: Google Maps API + Thickbox - 11651

⬅️ :: ➡️

Paul Clarke's blog - I live in Hythe near Folkestone. Wed to Clare + dad to two, I am a full-stack web engineer, + I do js / Node, some ruby, other languages ect ect. I like pubbing, parkrun, eating, home automation + other diy stuff, history, tree stuff, Television, squirrels, pirates, lego, + TIME TRAVEL.