Reading and Saving Directions returned by DirectionsService.route

2,332 views
Skip to first unread message

Hypnotizing Chickens

unread,
Mar 17, 2011, 2:53:21 AM3/17/11
to Google Maps JavaScript API v3
Hi
I am trying to save a route marked by a user and extract some data
from the marked route such as Origin, destination, way points etc.
While reading the object, it appears that sometimes the child object
inside the response which contains the origin, destination is named
"Hf" and sometimes the object is named "Gf". why is this happening?
what is a safe way of accessing those values?
Thanks.

Hypnotizing Chickens

unread,
Mar 17, 2011, 4:34:05 AM3/17/11
to Chris Broadfoot, google-map...@googlegroups.com
Let me rephrase my question - I am trying to capture the origin, destination and 2 way points marked in a form using the  draggable directions map which is based on the sample code given here:
http://code.google.com/apis/maps/documentation/javascript/examples/directions-draggable.html

How do I capture the origin, destination, and the way points which have been changed by the user?

Right now, I am parsing the saving the directionsresult as a hidden field and parsing it, but find the object to be inconsistent.

On Thu, Mar 17, 2011 at 1:52 PM, Chris Broadfoot <cb...@google.com> wrote:
Check the API docs:


--
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 google-map...@googlegroups.com.
To unsubscribe from this group, send email to google-maps-js-a...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-maps-js-api-v3?hl=en.




--
http://twitter.com/broady

Rossko

unread,
Mar 17, 2011, 5:01:35 AM3/17/11
to Google Maps JavaScript API v3
> How do I capture the origin, destination, and the way points which have been
> changed by the user?

example discussion
http://groups.google.com/group/google-maps-js-api-v3/browse_thread/thread/8cedc5ad11d9f034/9920f116510eaf46
There are more recent similar threads, but this groups 'search'
feature doesn't seem to find them.

Chris Broadfoot

unread,
Mar 17, 2011, 4:22:49 AM3/17/11
to google-map...@googlegroups.com, Hypnotizing Chickens
Check the API docs:

On Thu, Mar 17, 2011 at 5:53 PM, Hypnotizing Chickens <chicke...@gmail.com> wrote:
--
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 google-map...@googlegroups.com.
To unsubscribe from this group, send email to google-maps-js-a...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-maps-js-api-v3?hl=en.

Jayapal Chandran

unread,
May 24, 2011, 2:50:39 AM5/24/11
to google-map...@googlegroups.com
I was trying for saving waypoints and this should be useful to other users who are searching for the same.

I have created set of scripts to save the directions waypoints in the database also code to fetch that information back and display the waypoints in another map. I have provided html, php and sql files and complete explanation in this link.

http://vikku.info/programming/google-maps-v3/draggable-directions/saving-draggable-directions-saving-waypoints-google-directions-google-maps-v3.htm

Also you can copy the source code of that page and you can edit according to your preference and use the sql file for the database.
Reply all
Reply to author
Forward
0 new messages