Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mattpolito/cartographie
Beautiful map generation
https://github.com/mattpolito/cartographie
Last synced: 2 months ago
JSON representation
Beautiful map generation
- Host: GitHub
- URL: https://github.com/mattpolito/cartographie
- Owner: mattpolito
- License: mit
- Created: 2012-07-06T18:27:12.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2014-07-31T01:22:27.000Z (over 10 years ago)
- Last Synced: 2024-10-04T16:59:23.455Z (3 months ago)
- Language: Ruby
- Homepage:
- Size: 248 KB
- Stars: 10
- Watchers: 4
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Cartographie
Cartographie is a wrapper for Google's Static Maps API, but it can support your
own custom API, too!## Installation
Add this line to your application's Gemfile:
gem 'cartographie'
Or install it yourself as:
$ gem install cartographie
## Usage
```ruby
require 'cartographie'
Cartographie.map('San Francisco, CA')
Cartographie.map('New York, NY', width: 200, height: 200, zoom: 10)
```**Configuration**
```ruby
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## Contributing
1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request## Thanks
- @nurugger07
- @mattpolito
- @bthesorceror