How can I hide a google map until it is fully ready?
I use the following code at "page show":
code
setTimeout( function(){
var myOptions = { zoom :16, center: new google.maps.LatLng(newLat, newLng), mapTypeId: google.maps.MapTypeId.ROADMAP };
var map = new google.maps.Map($('div[dsid="Kaart"]').get(0), myOptions);
var sfLatlng = new google.maps.LatLng(newLat, newLng);
var marker = new google.maps.Marker({ position: sfLatlng, map: map, title: var2 });
}, 1000);
/code
The code works fine, but the result is that you first see a map on the location that is set in the map properties. When the timer is finished the map is moved to the correct location. Without the delay it does not work (map not ready?).
I tried hiding the map at page load an show again when the marker is set. Hiding is no problem, but showing again did not work (Appery('Kaart').show();).
How can I do this?