I would like to overlay the Polyline of a route obtained by the
Directions API with a second Polyline which shows the completed portion
of that route based on a specified distance (geolocation information is
not available). For example, if a user selects a route from Los Angeles
to New York, I would like to overlay the route with a Polyline which
represents the first 1000 miles of the route.


So far, the best solution I've found is as follows.


1. Use the DirectionService API to obtain the DirectionResult for the
entire route.
2. Obtain the route Polyline from the overview_path attribute of the
route and compute the distance between each point.
3. Create a new Polyline which includes the subset of points (and a
newly calculated point) which represent the required distance.



However, there are several problems with this algorithm due to the
limited number of points in the Polyline.


1. Since the Polyline represents only a subset of points related to the
route, the straight-line segments of the Polyline have a shorter total
distance than the actual distance specified with the leg attribute.
Since I know the ratio of the distances, I can compensate for this, but
the results cannot be entirely accurate.
2. When the user zooms in on the composite map, the deviations of the
Polyline from the actual route become immediately evident. This is my
major concern.


Is there another API available which might be more suitable for this
application? If not, is it possible to request a finer granularity of
points to be included in the overview_path?

-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps JavaScript API v3" 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-js-api-v3?hl=en.

Reply via email to