NAME
Geo::Google::Path - A path, by automobile, between two loci.
SYNOPSIS
use Geo::Google::Path;
# you shouldn't need to construct these yourself,
# have a Geo::Google object do it for you.
DESCRIPTION
Google Maps is able to serve up directions between two points. Directions consist of two types of components:
1. a series of points along a "polyline".
2. a series of annotations, each of which applies to a contiguous
range of points.
In the Geo::Google object model, directions are available by calling path() on a Geo::Google instance. The return value is a Geo::Google::Path object, which is a composite of Geo::Google::Segment objects, which are in turn composites of Geo::Google::Location objects.
OBJECT METHODS
Geo::Google::Path objects provide the following accessor methods
Method Description
------ -----------
distance length of the segment, in variable, human friendly units.
polyline a string encoding the points in the path.
levels a string containing information used for rendering the
polyline in an application like Google Maps.
panel HTML+JavaScript version of the driving directions for
use in an AJAX application. Google Maps uses this
data in the left hand panel of a directions search.
segments a list of Geo::Google::Segment segments along the path.
a segment has 0..1 driving directions associated with it.
time a time estimate, in variable, human-friendly units for how long
the segment will take to travel by automobile.
locations an array of Geo::Google::Location objects containing
the start point (element 0 of the array), the final
destination (the last element of the array), and any
waypoints between them that were used in the directions
query. There will always be at least two elements in
this array (start point and final destination).
toXML a method that renders the path in XML that could be used as
part of a Google Earth KML file.
toJSON a method that renders the path in JSON that could be used
with Google Maps.
SEE ALSO
AUTHOR
Allen Day <allenday@ucla.edu>, Michael Trowbridge <michael.a.trowbridge@gmail.com>
COPYRIGHT AND LICENSE
Copyright (c) 2004-2007 Allen Day. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.