Hi Mike,

I do like your suggestion but it kind of goes against the reason why I
started using the AJAX Feed API.

The final implementation I went with was using the GDownloadUrl,
mainly because it does have a callback so that you can tell when it's
been loaded.  Also something which you'd be happy about is that you
can only download from your local domain so it will force users to
save your script on their local webserver.

The code you modify from the sample above is:

    function mapsLoaded() {
        GDownloadUrl('/Scripts/elabel.js', ELabelDownloaded);
    }

    function ELabelDownloaded(data, responseCode) {
        eval(data);

        var center = new google.maps.LatLng(-33.866799, 151.209109);
        map = new google.maps.Map2(document.getElementById("map"));
        map.setCenter(center, 19);

        map.addOverlay(new ELabel(center, "test"));
    }

Where you have saved the elabel.js script in your webserver in the /
Scripts/ directory.

Cheers,

RodgerWilko!



On Feb 20, 11:33 am, Mike Williams <[email protected]> wrote:
> Wasn't it RodgerWilko! who wrote:
>
>
>
> >Hi,
>
> >Thanks Mike, I've tried that and am still getting an error that ELabel
> >is not defined .. code included for reference, and linked to your
> >website so it's easy for anyone to try.
>
> I forgot that GScript is also asynchronous, but it doesn't have a
> callback. I guess you could use the same technology as your initLoader()
> function to load elabels.js with callback.
>
> As a proof of concept, this works:
>
> setTimeout('map.addOverlay(new ELabel(new GLatLng(-33.866799,
> 151.209109), "test"))',2000);
>
> --http://econym.org.uk/gmap
> The Blackpool Community Church Javascript Team
--~--~---------~--~----~------------~-------~--~----~
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