As far as I can tell, so you should do it. At first I was also reluctant, as it seemed such an overkill, but as soon as I did it, everything worked perfectly. Here is an example implementation with a convenient callback delayedInit():
function Dummy(map) {
this.setMap(map);
}
Dummy.prototype = new google.maps.OverlayView();
Dummy.prototype.draw = function() {
if (!this.ready) {
this.ready = true;
google.maps.event.trigger(this, 'ready');
}
}
Dummy.prototype.onAdd = function(){
delayedInit();
}
var dum;
... and after creating your Google map:
dum = new Dummy(map);
source
share