Class: Decidim::Map::DynamicMap
- Defined in:
- lib/decidim/map/dynamic_map.rb
Overview
A base class for dynamic mapping functionality, common to all dynamic map services.
Direct Known Subclasses
Defined Under Namespace
Classes: Builder
Instance Attribute Summary
Attributes inherited from Utility
#configuration, #locale, #organization
Instance Method Summary collapse
-
#builder_class ⇒ Class
Returns the builder class for the map.
-
#builder_options ⇒ Hash
Returns the options for the default builder object.
-
#create_builder(template, options = {}) ⇒ Decidim::Map::DynamicMap::Builder
Creates a builder class for the front-end that is used to build the map HTML markup.
Methods inherited from Utility
Constructor Details
This class inherits a constructor from Decidim::Map::Utility
Instance Method Details
#builder_class ⇒ Class
Returns the builder class for the map. Allows fetching the class name dynamically also in the utility classes that extend this class.
23 24 25 |
# File 'lib/decidim/map/dynamic_map.rb', line 23 def builder_class self.class.const_get(:Builder) end |
#builder_options ⇒ Hash
Returns the options for the default builder object.
30 31 32 33 34 35 |
# File 'lib/decidim/map/dynamic_map.rb', line 30 def { marker_color: organization.colors.fetch("primary", "#ef604d"), tile_layer: tile_layer_configuration } end |
#create_builder(template, options = {}) ⇒ Decidim::Map::DynamicMap::Builder
Creates a builder class for the front-end that is used to build the map HTML markup.
15 16 17 |
# File 'lib/decidim/map/dynamic_map.rb', line 15 def create_builder(template, = {}) builder_class.new(template, .merge()) end |