You are here

function openlayers_behavior_popup::options_form in Openlayers 6.2

Same name and namespace in other branches
  1. 7.2 plugins/behaviors/openlayers_behavior_popup.inc \openlayers_behavior_popup::options_form()

Form defintion for per map customizations.

Overrides openlayers_behavior::options_form

File

includes/behaviors/openlayers_behavior_popup.inc, line 24
Implementation of OpenLayers behavior.

Class

openlayers_behavior_popup
Attribution Behavior

Code

function options_form($defaults) {

  // Only prompt for vector layers
  $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;
    }
  }
  return array(
    'layers' => array(
      '#title' => t('Layers'),
      '#type' => 'checkboxes',
      '#options' => $vector_layers,
      '#description' => t('Select layer to apply popups to.'),
      '#default_value' => isset($defaults['layers']) ? $defaults['layers'] : array(),
    ),
  );
}