leaflet-js wraps the Leaflet Javascript library in an asset gem so it can easily be used with Rails. It also includes the Leaflet.Label and Leaflet.Draw plusins. For more information about the Leaflet library, please visit leafletjs.com.
In your Gemfile, add this line:
gem “leaflet-js”
Then, run bundle install. You’re done!
Leaflet provides javascript, css and image assets. To use these assets in your project, either require the files below from your erb files or add them to your top level application.js and css files.
Leaflet provides the following assets:
leaflet.js leaflet.draw.js leaflet.label.js
leaflet.css leaflet.ie.css leaflet.draw.css leaflet.draw.ie.css leaflet.label.css
layers.png marker-icon.png [email protected] market-shadow.png spritesheet.png
If you have any questions about leaflet, please refer them to the Leaflet maintainers at leafletjs.com. If you have any questions about how leaflet-js wraps leaflet, then please refer to github.com/cfis/leaflet-js.
See LICENSE for license information about leaflet-js. Please note that the Leaflet project has its own LICENSE file also.