Beispiel #1
0
    def __init__(self, session, api_key, route_id):
        route = Route(session, route_id)

        self.__start_location = Location(session, route.get_start_location())
        self.__end_location = Location(session, route.get_end_location())

        maps_client = googlemaps.Client(key=api_key)

        now = datetime.now()

        self.__directions_result = maps_client.directions(
            self.__start_location.get_full_address(),
            self.__end_location.get_full_address(),
            mode="driving",
            departure_time=now)[0]