I need to place a Google map in Colorbox overlay and am wondering if there's a better way to do this. I've just started out with Google's tutorial so there's nothing fancy going on.
Right now I'm hiding the div that Google loads the map into:
<div style="width:0; height: 0; overflow: hidden;">
<div id="map_canvas" style="width:600px; height:400px; "></div>
</div>
Here's the call to Colorbox:
var latlng = new google.maps.LatLng(-34.397, 150.644);
var myOptions = { zoom: 8, center: latlng, mapTypeId: google.maps.MapTypeId.ROADMAP };
var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
$(document).ready(function(){
$("#farm_on_google_maps").colorbox({
inline: true,
width:700,
height:450,
href : '#map_canvas'
});
});
Even though it works, I wonder if the map could be loaded directly into Colorbox.