On Jun 9, 11:39 am, "rich...@home" <[email protected]> wrote:
>
> Is there an official (ie. not likely to change) way to get the encoded
> polyline string from a polyline object?

No, there is nothing in the documentation. That's unsurprising,
because it's considered that in creating a line you supplied its
vertices. It doesn't envisage getting a line from GDirections and
wanting to do something else with it, as well as putting it on a map.

> If not, do you suggest that I fetch the points using
> polyline.getVertex() and then re-encode the points ready for passing
> to the elevation API?

I wouldn't suggest that. I'd suggest ditching GDirections (which
doesn't allow you to do what you want to do) and substituting a call
to the web service: http://code.google.com/apis/maps/documentation/directions/
That does mean that you would need to do all the work GDirections does
in displaying the line and results table, etc, but it gives you the
line in a reliable manner. Displaying the table is covered by Mike's
tutorial at http://econym.org.uk/gmap/steps.htm although that does get
its data from GDirections. But it probably wouldn't be difficult to
adapt.

-- 
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