C404 / distance-matrix-api

Google Distance Matrix API Library for Elixir
MIT License
29 stars 7 forks source link

Unable to get distances for multiple origins to single destination #5

Open rvignesh89 opened 7 years ago

rvignesh89 commented 7 years ago

This is because travel_list expects a strict dictionary with both origin and destination keys present. Otherwise to_param() raises and error when it converts the dict to string.

I could add the same destination address for different origins to work around but considering that Google usage limits are calculated by element returned this doesn't seem like a viable option for me.

My suggestion would be get the coords in a matrix like how the actual api expects and then convert that into a the url. This would be really useful! I'll send a PR for this soon.

C404 commented 7 years ago

Hey !

Sorry for such a late answer. It is indeed a great idea and i'm also gonna rework some part of the library soon. I'll be more than happy to read your PR though.