CFenner / MMM-LocalTransport

A module for the MagicMirror to display informations about local tranportation.
MIT License
43 stars 15 forks source link

Allow the mode to be changed #24

Open thebeetleuk opened 6 years ago

thebeetleuk commented 6 years ago

Can you allow the mode to be changed. I have tried driving with no luck :(

https://developers.google.com/maps/documentation/embed/guide mode defines the method of travel. Options are driving, walking (which prefers pedestrian paths and sidewalks, where available), bicycling (which routes via bike paths and preferred streets where available), transit, or flying. If no mode is specified, the Google Maps Embed API will show one or more of the most relevant modes for the specified route.

GHLasse commented 6 years ago

This module is designed to interpret the answer of a request for local transport mode. The API reply for other modes looks slightly different and thus they will most likely fail to be displayed. I don't think this module should be supporting other modes, since it is a public transport module but maybe you want to create a new module based on this one, which shows the names of the roads to drive along? If you are just interested in the time it would take to go by car, I recommend you try my pull request #21 which contains an option to display the duration of going by car. You can also look at the code of that to see how I changed the mode in the request.