Keep a Google Maps v3 Map hidden, show when needed
Or you could just hide it like with css visablility or css opacity.
$("#GoogleMap").css({ opacity: 0, zoom: 0 });
initialize();
google.maps.event.addListener(map,"idle", function(){
$('#Loader').hide();
$("#GoogleMap").css({ opacity: 1, zoom: 1 });
});
Also remember to call:
google.maps.event.trigger(map, 'resize');
if you have changed the size of the <div>
. A display:none
<div>
has no size.