OK I've tried to figure this out, but haven't had much luck.

I'm trying to detect when map load is complete before using the
Mootools JS2.0 library to fade in my Google Map DIV.

I have this code
<code>
        GEvent.addListener(map, "load", function() {
                alert('Hello World'); // fadeIn('google_map');
        });
</code>

But the event never fires, any other event type works fine though.
"move, "dragend" etc...

Can anyone see what I'm doing wrong ? Any ideas ?


<code>
/*      MOOTOOLS
        ---------------------------------------------------- */
var fade;


/*      GOOGLE MAPS
        ---------------------------------------------------- */
// Set variables
var map;
var geocoder = new GClientGeocoder();

function mapGoto(point){
        scrollTo(0,0);
        var coords = point.split(',');
        var latlng = new
GLatLng(parseFloat(coords[0]),parseFloat(coords[1]));
        map.setCenter(latlng,10);
        map.addOverlay(new GMarker(latlng));
        GEvent.addListener(map, "load", function() {
                alert('Hello World'); // fadeIn('google_map');
        });
}

// Function to Load the Maps
function init_map(){
        if (GBrowserIsCompatible())
        {
                // Setup initial map.
                map = new GMap2(document.getElementById('google_map'));
                map.addControl(new GSmallMapControl());
                map.addControl(new GMapTypeControl());
                /* Configuration Options */
                map.enableDragging();
                map.enableDoubleClickZoom();
                map.clearOverlays();
        } // END if (GBrowserIsCompatible())
} // END function init_map()

function fadeIn(el)
{
        if(fade) fade.stop;
        var el = $(''+el+'');
        el.setStyles({display:'block',opacity: 0});
        fade = new Fx.Style(el, 'opacity', {duration: 600});
        fade.start(0,1);
}
</code>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Maps API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Maps-API?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to