Class: Ropenlayer::Openlayer::BoxControl::LayersSelect
- Defined in:
- lib/ropenlayer/openlayer/box_control/layers_select.rb
Instance Attribute Summary
Attributes inherited from Base
#js_links_id, #links, #map, #name
Instance Method Summary collapse
-
#initialize(map) ⇒ LayersSelect
constructor
A new instance of LayersSelect.
Methods inherited from Base
Constructor Details
#initialize(map) ⇒ LayersSelect
Returns a new instance of LayersSelect.
5 6 7 8 9 10 11 12 13 |
# File 'lib/ropenlayer/openlayer/box_control/layers_select.rb', line 5 def initialize(map) super('layers_select', map, :css_class => 'olControlLayersBoxControl') map.layers.uniq.each do |layer| @links << { :id => "'link_to_base_layer_#{ layer.name }'", :class => "'olControlLayersBoxControl'", :text => " ยป Usar Mapa #{ layer.config[:description] }", :onclick => "#{ map.js_id }.setBaseLayer(#{ layer.js_id }); #{ map.js_helper.hide_xhtml_element(@js_links_id ) }; return false;" } end end |