GoogleMapsRails
This is a simple library for embed google maps in your app rails
Installation
Add this line to your application's Gemfile:
gem 'google_maps_rails'And then execute:
$ bundle install
Or install it yourself as:
$ gem install google_maps_rails
Usage
Add the code, and create attributes, in local where you want embed the map.
| Attribute | Type | Default value |
|---|---|---|
| lat | String | nil |
| long | String | nil |
| address | String | nil |
| width | String | 500 |
| height | String | 500 |
# Lat and Long
embed_google_maps(lat: '-20.262197', long: '-54.799805')
# => return: <iframe src='https://maps.google.com/maps?q=-20.262197,-54.799805&output=embed' frameborder='0' style='border:0' width='250' height='250' allowfullscreen></iframe>
# Address
embed_google_maps(address: 'address name and number, 5555')
# => return: <iframe src='https://maps.google.com/maps?q=name%20address%2C%205555&output=embed' frameborder='0' style='border:0' width='250' height='250' allowfullscreen></iframe>license
See Mit license http://luizpicolo.mit-license.org/
Contributing
- Fork it ( https://github.com/[my-github-username]/google_maps_rails/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