If you want to simply calculate the distance between the two addresses, you can use the gem to complete your work.
Add this line to your application's Gemfile:
gem 'estimate_distance'And then execute:
$ bundle
Or install it yourself as:
$ gem install estimate_distance
Before you get the distance between two points, you must pass the detailed address of two points as a parameter.
For example: EstimateDistance.direct_calculate_distance(former_address,latter_address)
Then,you can get the distance between two points
- Fork it ( https://github.com/[my-github-username]/estimate_distance/fork )
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request