curl -s "https://maps.googleapis.com/maps/api/directions/json?origin=43.651070,-79.347015&destination=45.501690,-73.567253&mode=bicycling&key=YourKey"
#wget -qO- "https://maps.googleapis.com/maps/api/directions/json?origin=43.651070,-79.347015&destination=45.501690,-73.567253&mode=bicycling&key=YourKey"
origin
origin=纬度,经度
destination
destination=纬度,经度
mode
driving:驾车
walking:步行
bicycling:骑行
transit:公共交通
{
"geocoded_waypoints" :
[
{
"geocoder_status" : "OK",
"place_id" : "ChIJFe-LBhLL1IkRuVeTL_UvHtU",
"types" :
[
"street_address"
]
},
{
"geocoder_status" : "OK",
"place_id" : "ChIJDQhsvi44K4gR7ueA_1qaYPk",
"types" :
[
"street_address"
]
}
],
"routes" :
[
{
"bounds" :
{
"northeast" :
{
"lat" : 43.6555158,
"lng" : -79.3469623
},
"southwest" :
{
"lat" : 43.6146554,
"lng" : -79.56953109999999
}
},
"copyrights" : "Map data ©2024 Google",
"legs" :
[
{
"distance" :
{
"text" : "23.8 km",
"value" : 23807
},
"duration" :
{
"text" : "24 mins",
"value" : 1468
},
"end_address" : "75 Applewood Ln, Etobicoke, ON M9C 0C1, Canada",
"end_location" :
{
"lat" : 43.6510645,
"lng" : -79.56727619999999
},
"start_address" : "337 Gardiner Expy, Toronto, ON M4M, Canada",
"start_location" :
{
"lat" : 43.6510919,
"lng" : -79.3469623
},
"steps" :
[
{
"distance" :
{
"text" : "2.1 km",
"value" : 2056
},
"duration" :
{
"text" : "6 mins",
"value" : 331
},
"end_location" :
{
"lat" : 43.6457503,
"lng" : -79.37006649999999
},
"html_instructions" : "Head \u003cb\u003enorthwest\u003c/b\u003e on \u003cb\u003eLake Shore Blvd E\u003c/b\u003e toward \u003cb\u003eLake Shore Blvd E\u003c/b\u003e",
"polyline" :
{
"points" : "irliGnmhcNMJC@FRPj@Nf@@BNf@@@Rt@b@|ADR@BHVZz@@BHV@D^bAZx@f@xAPf@Rr@Xz@Vt@Jb@H\\DRHXh@nCBJBLFVNh@HR@BNb@f@zAHXDPBT@J@J@L?H?JAHAVANAPCLCLO\\Wh@QXSZKJY\\M\\O`@ITETGVCNAF?P@V?RBP@J^fBFXF\\BFHNNn@Ln@v@dDDN\\~AZlA?BLd@b@hBHZHZf@bCd@pBXzAb@`CRjBVbBH\\n@fGDTT|A\\dCHp@^jCR~A\\nCPtAD^"
},
"start_location" :
{
"lat" : 43.6510919,
"lng" : -79.3469623
},
"travel_mode" : "DRIVING"
},
{
"distance" :
{
"text" : "14.5 km",
"value" : 14543
},
"duration" :
{
"text" : "12 mins",
"value" : 743
},
"end_location" :
{
"lat" : 43.61581169999999,
"lng" : -79.5373113
},
"html_instructions" : "Turn \u003cb\u003eright\u003c/b\u003e to merge onto \u003cb\u003eFrederick G. Gardiner Expy\u003c/b\u003e/\u003cwbr/\u003e\u003cb\u003eGardiner Expy W\u003c/b\u003e",
"maneuver" : "ramp-right",
"polyline" :
{
"points" : "}pkiG|}lcNM\\?BAB?@?@?J@XR|ATdBZhCHn@R|AFf@P`BFn@@?Hn@F`@Lh@?@Jd@Rv@Rn@@Bd@pA@?d@nABF@DBBPJZz@Zz@HPHRjApC\\x@Zz@JTf@lAr@`BDPFNXr@JXHZd@bAL\\d@fARh@Rf@`@dA^~@j@jAN`@\\x@JZv@vC~@xEDXRtAV~ADTD\\Hd@Fh@Ff@DXJn&