You are here

public function openlayers_plus_behavior_legend::options_form in OpenLayers Plus 7.2

Same name and namespace in other branches
  1. 7.3 behaviors/openlayers_plus_behavior_legend.inc \openlayers_plus_behavior_legend::options_form()

Override of options_form().

Overrides openlayers_behavior::options_form

File

behaviors/openlayers_plus_behavior_legend.inc, line 20
A block in a corner of a map that provides information on layers

Class

openlayers_plus_behavior_legend
@file A block in a corner of a map that provides information on layers

Code

public function options_form($defaults = array()) {
  $vector_layers = array();
  foreach ($this->map['layers'] as $id => $name) {
    $layer = openlayers_layer_load($id);
    if (isset($layer->data['vector']) && $layer->data['vector'] == TRUE) {
      $vector_layers[$id] = $name;
    }
  }
  $options['layers'] = array(
    '#title' => t('Layers'),
    '#type' => 'checkboxes',
    '#options' => $vector_layers,
    '#description' => t('Select layers to add legend.'),
    '#default_value' => isset($defaults['layers']) ? $defaults['layers'] : array(),
  );
  return $options;
}