Class: Decidim::Map::DynamicMap::Builder
- Inherits:
- 
      Frontend::Builder
      
        - Object
- Frontend::Builder
- Decidim::Map::DynamicMap::Builder
 
- Defined in:
- lib/decidim/map/dynamic_map.rb
Overview
A builder for the dynamic maps to be used in the views. Provides all the necessary functionality to display and initialize the maps.
Direct Known Subclasses
Instance Method Summary collapse
- #javascript_snippets ⇒ Object
- 
  
    
      #map_element(html_options = {})  ⇒ String 
    
    
  
  
  
  
  
  
  
  
  
    Displays the map element’s markup for the view. 
- #stylesheet_snippets ⇒ Object
Methods inherited from Frontend::Builder
Constructor Details
This class inherits a constructor from Decidim::Map::Frontend::Builder
Instance Method Details
#javascript_snippets ⇒ Object
| 83 84 85 | # File 'lib/decidim/map/dynamic_map.rb', line 83 def javascript_snippets template.javascript_include_tag("decidim/map/provider/default") end | 
#map_element(html_options = {}) ⇒ String
Displays the map element’s markup for the view.
| 63 64 65 66 67 68 69 70 71 72 73 74 75 | # File 'lib/decidim/map/dynamic_map.rb', line 63 def map_element( = {}) = { "data-decidim-map" => .to_json, # The data-markers-data is kept for backwards compatibility "data-markers-data" => .fetch(:markers, []).to_json }.merge() content = template.capture { yield }.html_safe if block_given? template.content_tag(:div, ) do (content || "") end end | 
#stylesheet_snippets ⇒ Object
| 78 79 80 | # File 'lib/decidim/map/dynamic_map.rb', line 78 def stylesheet_snippets template.stylesheet_link_tag("decidim/map") end |