Hi,

I am running a google maps mashup site for displaying UK schools, with
league table information (http://www.schoolmap.org.uk/). I am using
the google geocoder to allow users to select their location, and
display local schools in their area. I want to be able to display
distance information between them and the schools. I am using the
following code snippet (console logging removed):

        var from = school.address;
        var to = place.address;
        directions.clear();
        directions.load(
            "from " + from + " to " + to,
            { preserveViewport:true, travelMode:"walking" }
        );
        var nroutes = directions.getNumRoutes();
        if ( nroutes == -1 ) return;
        var route = directions.getRoute( 0 );
        var distance = route.getDistance();

Although the route is displayed fine on the map and in the directions
in the panel, the code throws the following:

this.dk is null

To invoke this code, you need to type in an appropriate (UK) geocoding
string into the "address" input, and press "goto", and then click on
one of the "[ calculate ]" links under the "distance" column in the
schools table.

If you run it in firefox with firebug installed, you should see some
relevant console logging to see the point at which the exception is
thrown. Any help with this much appreciated!

Ave.
--~--~---------~--~----~------------~-------~--~----~
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