-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changes to the way the data is presented.
- Loading branch information
Showing
2 changed files
with
47 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import googlemaps | ||
from datetime import datetime | ||
|
||
gmaps = googlemaps.Client(key="AIzaSyBYhkmFKfz745tUYWf5CskwslxKan6M_-E") | ||
|
||
|
||
# Request directions via public transit | ||
|
||
def return_dir(locations): | ||
now = datetime.now() | ||
concat = "" | ||
for loc in locations[1:-2]: | ||
concat += loc + '|' | ||
concat = concat[:-1] | ||
directions_result = gmaps.directions( | ||
locations[0],locations[-1],mode="walking",departure_time=now,waypoints=concat) | ||
return directions_result | ||
|
||
|
||
""" | ||
if __name__ == '__main__': | ||
print(return_dir(['Bahen Center', 'Myhal Center', 'Leslie Dan'])) | ||
acc = return_dir(['Bahen Center', 'Myhal Center', 'Leslie Dan']) | ||
for legs in acc['legs']: | ||
print(acc[legs]["html_instructions"]) | ||
""" |