I'm trying to implement similar--I want to extract polyline vertices
from a GDirections call. Can somebody please take a look at my
attempt? Any obvious errors?
function initialize() {
geocoder = new GClientGeocoder();
gDir = new GDirections();
GEvent.addListener(gDir, "load", function() {
var drivingDistanceMiles = gDir.getDistance().meters / 1609.344;
var drivingDistanceKilometers = gDir.getDistance().meters / 1000;
var drivingDuration=gDir.getDuration();
var poly = gDir.getPolyline();
var points = new Array();
for (var i=0; i<poly.getVertexCount; i++){
points.push( poly.getVertex(i) );
for (i=0;i<points.length;i++){document.write(points[i] + "<br >");}
......
On Aug 11, 7:07 am, Mike Williams <[email protected]> wrote:
> varpoints= new Array();
>
> for (var i=0; i<poly.getVertexCount; i++) {
> points.push( poly.getVertex(i) );
>
> }
>
> --
> Mike Williamshttp://econym.org.uk/gmap
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---