Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/camertron/jvectormap-rails
jVectorMap for the Rails asset pipeline
https://github.com/camertron/jvectormap-rails
Last synced: 2 months ago
JSON representation
jVectorMap for the Rails asset pipeline
- Host: GitHub
- URL: https://github.com/camertron/jvectormap-rails
- Owner: camertron
- License: other
- Created: 2013-01-20T08:52:20.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2020-09-04T04:37:27.000Z (over 4 years ago)
- Last Synced: 2024-10-11T12:23:56.006Z (3 months ago)
- Language: Ruby
- Size: 5.31 MB
- Stars: 4
- Watchers: 3
- Forks: 15
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
jvectormap-rails
================[jVectorMap](http://jvectormap.com/) for the Rails asset pipeline
### Installation
Add it to your `Gemfile`:
```
gem 'jvectormap-rails'
```### Usage
You can add jvectormap-rails to your `application.js` file using a require statement like this:
```
//= require jvectormap
```Don't forget to add the CSS to your `application.css` file too:
```
*= require 'jvectormap'
```To add support for whatever maps you want to use, include them in `application.js`:
```
//= require jvectormap/maps/us_merc_en
```The basic pattern is `{country}-{region}_{city}_{projection}`. For example, the map `us-il-chicago_mill` has a country of `us` (United States), region of `il` (Illinois), city of `chicago`, and a projection of `mill` (Miller). Other common projections include Mercator (`merc`), and Albers equal area (`aea`).
### Asset Precompilation
jvectormap-rails supports precompiling individual maps. Add an initializer to your app, eg. `config/initializers/jvectormap.rb`:
```ruby
JVectorMap::Rails.precompile_maps << 'us_merc'
```### Rake Tasks
Get a list of all available maps by running this from within your Rails app's root:
```
bundle exec rake jvectormap:maps
```### License
Licensed under the MIT license.
### Authors
1. This gem: Cameron Dutro [@camertron](http://twitter.com/camertron)
2. jVectorMap: Kirill Lebedev, it's [on github](https://github.com/bjornd/jvectormap)