Wasn't it trice22 who wrote:
> directions.load("from: Address 1 to: Address 2");
> GEvent.addListener(directions.getMarker(0), "click", function()
GDirections is asynchronous.
directions.getMarker(0) doesn't work until after a successful reply has
been received.
Try:
GEvent.addListener(directions,"load", function() {
// Kill the existing API GDirections listener
GEvent.clearListeners(directions.getMarker(0),"click");
// Add your listener
GEvent.addListener(directions.getMarker(0), "click", function() {
directions.getMarker(0).openInfoWindowHtml('<p>Text here and
here</p>');
});
});
[You probably don't really need to kill the existing listener, if you
don't your info window will probably overwrite the one created by the
API fast enough that the user won't notice it.]
--
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
-~----------~----~----~----~------~----~------~--~---