{"id":15288846,"url":"https://github.com/nbulaj/mapbox-gl-rails","last_synced_at":"2025-04-05T13:08:40.714Z","repository":{"id":56882775,"uuid":"118096623","full_name":"nbulaj/mapbox-gl-rails","owner":"nbulaj","description":"A gem to provide Mapbox GL JS and it's ecosystem (plugins) for Rails applications :train2:","archived":false,"fork":false,"pushed_at":"2024-10-14T08:20:32.000Z","size":34388,"stargazers_count":37,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-29T12:09:17.338Z","etag":null,"topics":["assets-pipeline","mapbox-gl-js","mapboxgl","rails","ruby-on-rails"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nbulaj.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-01-19T08:10:37.000Z","updated_at":"2025-01-17T22:43:38.000Z","dependencies_parsed_at":"2024-10-23T02:55:50.935Z","dependency_job_id":null,"html_url":"https://github.com/nbulaj/mapbox-gl-rails","commit_stats":{"total_commits":54,"total_committers":4,"mean_commits":13.5,"dds":"0.12962962962962965","last_synced_commit":"b3e64882da9611f192c0250b4c8162ad3249d949"},"previous_names":[],"tags_count":32,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nbulaj%2Fmapbox-gl-rails","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nbulaj%2Fmapbox-gl-rails/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nbulaj%2Fmapbox-gl-rails/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nbulaj%2Fmapbox-gl-rails/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nbulaj","download_url":"https://codeload.github.com/nbulaj/mapbox-gl-rails/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247339158,"owners_count":20923014,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["assets-pipeline","mapbox-gl-js","mapboxgl","rails","ruby-on-rails"],"created_at":"2024-09-30T15:53:22.922Z","updated_at":"2025-04-05T13:08:40.698Z","avatar_url":"https://github.com/nbulaj.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Mapbox for Rails\n\n[![Gem Version](https://badge.fury.io/rb/mapbox-gl-rails.svg)](http://badge.fury.io/rb/mapbox-gl-rails)\n[![Build Status](https://travis-ci.org/nbulaj/mapbox-gl-rails.svg?branch=master)](https://travis-ci.org/nbulaj/mapbox-gl-rails)\n[![License](http://img.shields.io/badge/license-MIT-brightgreen.svg)](#license)\n\n`mapbox-gl-rails` provides the [Mapbox GL JS](https://github.com/mapbox/mapbox-gl-js) library as a Rails engine for\nuse with the asset pipeline. It uses the same versioning as the Mapbox GL JS.\n\nSupports Rails \u003e= 3.2 (see [Travis build matrix]((.travis.yml))).\n\n## Installation\n\nAdd this to your Gemfile:\n\n```ruby\ngem 'mapbox-gl-rails'\n```\n\nand run `bundle install`.\n\n## Usage\n\nIn your `application.js`, include the following:\n\n```js\n//\n//*= require mapbox-gl\n//= require_tree .\n```\n\nIn your `application.css`, include the css file:\n\n```css\n/*\n *= require mapbox-gl\n */\n```\n\nThen restart your webserver if it was previously running.\n\nCongrats! You now have Mapbox GL JS on board and check out the\n[Mapbox Examples](https://www.mapbox.com/mapbox-gl-js/examples).\n\nIf you need to use any available plugins, then don't forget to add them to `application.js` and `application.css`:\n\nJS:\n\n```js\n//*= require mapbox-gl-geocoder\n// ...\n````\n\nCSS:\n\n```css\n/*\n *= require mapbox-gl-geocoder\n *= require mapbox-gl-draw\n *= require mapbox-gl-directions\n *= require mapbox-gl-compare\n ...\n */\n```\n\nFull list of integrated plugins you could find [here](https://github.com/nbulaj/mapbox-gl-rails/blob/master/plugins.yaml).\n\n### Sass Support\n\nIf you prefer [SCSS](http://sass-lang.com/documentation/file.SASS_REFERENCE.html), add this to your\n`application.css.scss` file:\n\n```scss\n@import 'mapbox-gl';\n```\n\nIf you use the [Sass indented syntax](http://sass-lang.com/docs/yardoc/file.INDENTED_SYNTAX.html),\nadd this to your `application.css.sass` file:\n\n```sass\n@import mapbox-gl\n```\n\n## Misc\n\n### Rails engines\n\nWhen building a Rails engine that includes mapbox-gl-rails as a dependency,\nbe sure to `require \"mapbox-gl-rails\"` somewhere during the intialization of\nyour engine. Otherwise, Rails will not automatically pick up the load path of\nthe mapbox-gl-rails assets and helpers.\n\n### Deploying to sub-folders\n\nIt is sometimes the case that deploying a Rails application to a production\nenvironment requires the application to be hosted at a sub-folder on the server.\nThis may be the case, for example, if Apache HTTPD or Nginx is being used as a\nfront-end proxy server, with Rails handling only requests that come in to a sub-folder\nsuch as `http://example.com/myrailsapp`. In this case, the\nMapboxRails gem (and other asset-serving engines) needs to know the sub-folder,\notherwise you can experience a problem roughly described as [\"my app works\nfine in development, but fails when I deploy\nit\"](https://github.com/bokmann/font-awesome-rails/issues/74).\n\nTo fix this, set the *relative URL root* for the application. In the\nenvironment file for the deployed version of the app, for example\n`config/environments/production.rb`,\nset the config option `action_controller.relative_url_root`:\n\n    MyApp::Application.configure do\n      ...\n\n      # set the relative root, because we're deploying to /myrailsapp\n      config.action_controller.relative_url_root  = \"/myrailsapp\"\n\n      ...\n    end\n\nThe default value of this variable is taken from `ENV['RAILS_RELATIVE_URL_ROOT']`,\nso configuring the environment to define `RAILS_RELATIVE_URL_ROOT` is an alternative strategy.\n\nIn addition you need to indicate the subfolder when you *precompile* the assets:\n\n    RAILS_ENV=production bundle exec rake assets:precompile RAILS_RELATIVE_URL_ROOT=/myrailsapp\n\n### Rails 3.2\n\n**Note:** In Rails 3.2, make sure mapbox-gl-rails is outside the bundler asset group\nso that these helpers are automatically loaded in production environments.\n\n## Versioning\n\nVersioning follows the core releases of Mapbox GL JS which follows Semantic\nVersioning 2.0 as defined at \u003chttp://semver.org\u003e. We will do our best not to\nmake any breaking changes until Mapbox core makes a major version bump.\n\nAdditional build number can be added to fix internal gem errors (like 0.43.0.**0**).\n\n## Releasing\n\n1. Update gem version in `lib/mapbox-gl/rails/version.rb` to match latest MapBox GL version.\n2. Run `bundle exec rake update` (this will automatically load and convert assets).\n3. Commit\n4. Create gem and push it to Rubygems\n5. Create a GitHub release.\n\n## License\n\n* The [Mapbox GL JS](https://github.com/mapbox/mapbox-gl-js) and it's components are\n  licensed under [their own licenses](https://github.com/mapbox/mapbox-gl-js/blob/master/LICENSE.txt).\n* The remainder of the mapbox-gl-rails project is licensed under the\n  [MIT License](http://opensource.org/licenses/mit-license.html).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnbulaj%2Fmapbox-gl-rails","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnbulaj%2Fmapbox-gl-rails","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnbulaj%2Fmapbox-gl-rails/lists"}