Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

jvectormap-rails

Package Overview
Dependencies
Maintainers
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jvectormap-rails

  • 2.0.0
  • Rubygems
  • Socket score

Version published
Maintainers
2
Created
Source

jvectormap-rails

jVectorMap for the Rails asset pipeline

Installation

Add it to your Gemfile:

gem 'jvectormap-rails', '~> 1.0.0'

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:

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
  2. jVectorMap: Kirill Lebedev, it's on github

FAQs

Package last updated on 28 Oct 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc