File: leaflet-rails.rb

package info (click to toggle)
ruby-leaflet-rails 1.6.0%2Bdfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 984 kB
  • sloc: ruby: 381; sh: 43; makefile: 9
file content (24 lines) | stat: -rw-r--r-- 648 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
require "leaflet-rails/version"
require "leaflet-rails/view_helpers"
require "rails"

module Leaflet
  mattr_accessor :tile_layer
  mattr_accessor :attribution
  mattr_accessor :max_zoom
  mattr_accessor :subdomains
  
  module Rails
    class Engine < ::Rails::Engine
      initializer 'leaflet-rails.precompile' do |app|
        if app.config.respond_to? (:assets)
          app.config.assets.precompile += %w(layers-2x.png layers.png marker-icon-2x.png marker-icon.png marker-shadow.png)
        end
      end

      initializer 'leaflet-rails.helpers' do
        ActionView::Base.send :include, Leaflet::ViewHelpers
      end
    end
  end
end