From 92bfa3d693b30b602fd05fd9954beee996a8be29 Mon Sep 17 00:00:00 2001 From: Nikolai Date: Fri, 28 Aug 2015 11:16:05 +0100 Subject: [PATCH] updated readme --- README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/README.md b/README.md index 87bc18e..73a9990 100644 --- a/README.md +++ b/README.md @@ -113,6 +113,7 @@ Valid values are: * driving (default) indicates standard driving directions using the road network. * walking requests walking directions via pedestrian paths & sidewalks (where available). * bicycling requests bicycling directions via bicycle paths & preferred streets (currently only available in the US and some Canadian cities). +* transit requests distance calculation via public transit routes (where available). Avoid parameter - Directions may be calculated that adhere to certain restrictions. Restrictions are indicated by use of the avoid parameter, and an argument to that parameter indicating the restriction to avoid. @@ -176,6 +177,19 @@ for item in items: print('duration: %s' % item.duration) ``` +Mode Transit: +```python +items = google_maps.distance(origins, destinations, const.MODE_TRANSIT).all() + +for item in items: + print('origin: %s' % item.origin) + print('destination: %s' % item.destination) + print('km: %s' % item.distance.kilometers) + print('m: %s' % item.distance.meters) + print('miles: %s' % item.distance.miles) + print('duration: %s' % item.duration) +``` + Mode Highway: ```python items = google_maps.distance(origins, destinations, avoid=const.AVOID_HIGHWAYS).all()