Getting coordinates and names for a route
Hi everyone,
Finally I got the solution, google also provides driving directions in JSON format, we can parse the JSON data and this will give all the details including coordinates, name, description, distance and approximate time.
example:
http://maps.google.com/maps/nav?key=YOUR-MAP-KEY&output=json&q=from:sourceAddress in: destinationAddress
Thank you all for your support
source to share
Of course see the docs . You create a GDirections object (no div
AND without map
, so nothing will be displayed by default and you will handle all of the display) and call its method load
specifying getPolyline
and getSteps
as true (so you get polyline and text directions despite no div and map) ...
The load
GDirections object event fires when the results are ready. Then you use methods getPolyline
, getNumRoutes
and getRoute
on the object to get the results.
For a complete reference also check out this (both GDirections and GDirectionsOptions) ...!
source to share
The Google API documentation has a section on XML queries and parsing . It's quite detailed, there are a lot of options available.
source to share