Class: Geoblacklight::Configuration::LeafletConfig
- Inherits:
-
Object
- Object
- Geoblacklight::Configuration::LeafletConfig
- Includes:
- ActiveModel::Attributes, ActiveModel::Model
- Defined in:
- lib/geoblacklight/configuration/leaflet_config.rb
Constant Summary collapse
- DEFAULT_LAYERS_CONFIG =
{ index: { DEFAULT: { color: "#7FCDBB", weight: 1, radius: 4, sr_color_name: "Green" }, UNAVAILABLE: { weight: 1, radius: 4, color: "#EDF8B1", sr_color_name: "Yellow" }, SELECTED: { weight: 1, radius: 4, color: "#2C7FB8", sr_color_name: "Blue" } } }.freeze
- DEFAULT_SLEEP_CONFIG =
{ sleep: true, # set to false to disable margin_distance: 100, # set to zero / false if you want to disable this check sleeptime: 750, waketime: 750, hovertowake: false, message: "Click to Wake", background: "rgba(214, 214, 214, .7)" }.freeze
Instance Attribute Summary collapse
-
#bounds_overlay ⇒ Object
Returns the value of attribute bounds_overlay.
-
#controls ⇒ Object
Returns the value of attribute controls.
-
#layers ⇒ Object
Returns the value of attribute layers.
-
#sleep ⇒ Object
Returns the value of attribute sleep.
Instance Method Summary collapse
-
#initialize ⇒ LeafletConfig
constructor
A new instance of LeafletConfig.
- #to_h ⇒ Object
Constructor Details
#initialize ⇒ LeafletConfig
Returns a new instance of LeafletConfig.
47 48 49 50 51 |
# File 'lib/geoblacklight/configuration/leaflet_config.rb', line 47 def initialize super @sleep = LeafletSleepConfig.new(DEFAULT_SLEEP_CONFIG) @layers = LeafletLayersConfig.new(DEFAULT_LAYERS_CONFIG) end |
Instance Attribute Details
#bounds_overlay ⇒ Object
Returns the value of attribute bounds_overlay.
7 8 9 |
# File 'lib/geoblacklight/configuration/leaflet_config.rb', line 7 def @bounds_overlay end |
#controls ⇒ Object
Returns the value of attribute controls.
7 8 9 |
# File 'lib/geoblacklight/configuration/leaflet_config.rb', line 7 def controls @controls end |
#layers ⇒ Object
Returns the value of attribute layers.
9 10 11 |
# File 'lib/geoblacklight/configuration/leaflet_config.rb', line 9 def layers @layers end |
#sleep ⇒ Object
Returns the value of attribute sleep.
9 10 11 |
# File 'lib/geoblacklight/configuration/leaflet_config.rb', line 9 def sleep @sleep end |
Instance Method Details
#to_h ⇒ Object
61 62 63 64 65 66 67 68 69 70 |
# File 'lib/geoblacklight/configuration/leaflet_config.rb', line 61 def to_h { bounds_overlay: , selected_color: selected_color, sleep: sleep.to_h, sidebar: , layers: layers.to_h, controls: controls }.compact end |