witnessmenow / arduino-google-maps-api

An Arduino library for communicating with the Google Maps Api
GNU General Public License v2.0
48 stars 20 forks source link

Support for parameter "avoid" #3

Open chunkysteveo opened 7 years ago

chunkysteveo commented 7 years ago

Great API, was just about to hack up your YouTube API to get a "traffic" api, but here we are!

I always try to avoid a toll road near me, so the ability to set parameter "avoid" would be great use. The "avoid" parameter allows only one argument from the following available list:

avoid=tolls avoid=highways avoid=ferries avoid=indoor

Would be great to add this in?

Steve

witnessmenow commented 7 years ago

Hey Steve,

Yeah that sounds like a good idea!

I'm really busy for the next few weeks but if you wanted to raise a pull request for the change I would be happy to merge.

It should be really easy too add, just add another optional parameter to the function, and then add the avoid parameter to the URL that is generated

I can take it up in a few weeks if needed but I can try help if you want to give it a go

Brian

chunkysteveo commented 7 years ago

I will give it a go - not pulled or supported any repo's on Github yet, but will have a stab at it. Had a look at the code and was just going to hack it for my purpose, but thought it would be useful to add into the master.

Cheers,

Steve

witnessmenow commented 7 years ago

@chunkysteveo I have released a new version today, mainly focused on the directions api (they seem really similar, except directions supports waypoints so you can get traffic times for specific routes)

I added the avoid parameter to that, check out the example

Hope this helps

chunkysteveo commented 7 years ago

Thanks Brian, will give it a go! Sorry I never got round to create a pull and adding in the "Avoid" parameter. I put that project on the back burner after testing, as it seemed a little daft for me to use in the office... I created a NEOPIXEL ring that went Green, Orange, Red based on the traffic route home... but all it did was stay Green all day until it was time to leave and it went "Red-er" and "Red-er" lol!!

Will give the directions API a go though, and my ring thing will be of some use to someone... so I will aim to write it up as a tutorial somewhere/sometime!

Cheers,

Steve