Cartographie is a wrapper for Google's Static Maps API, but it can support your own custom API, too!
Add this line to your application's Gemfile:
gem 'cartographie'
Or install it yourself as:
$ gem install cartographie
require 'cartographie'
Cartographie.map('San Francisco, CA')
Cartographie.map('New York, NY', width: 200, height: 200, zoom: 10)
Configuration
Cartographie.configure do |config|
config.api_endpoint = 'http://example.com/api/map'
config.width = 640
config.height = 640
config.zoom = 12
config.file_format = 'jpg'
config.sensor = true
end
Defaults
If you do not pass options when generating a map, nor configure a map attribute using the configuration block, the following values will be used:
- api endpoint: 'http://maps.googleapis.com/maps/api/staticmap'
- width: 300
- height: 300
- zoom: 15
- format: 'png'
- sensor: false
- Fork it
- 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 new Pull Request
- @nurugger07
- @mattpolito
- @bthesorceror