You are here

function openlayers_behavior_drawfeatures::options_form in Openlayers 6.2

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

Overrides openlayers_behavior::options_form

File

includes/behaviors/openlayers_behavior_drawfeatures.inc, line 23
Implementation of OpenLayers behavior.

Class

openlayers_behavior_drawfeatures
Draw Features behavior.

Code

function options_form($defaults = array()) {
  $features = array(
    'point' => t('Point'),
    'path' => t('Path'),
    'polygon' => t('Polygon'),
  );
  return array(
    'feature_types' => array(
      '#title' => t('Available Features'),
      '#type' => 'checkboxes',
      '#options' => $features,
      '#description' => t('Select what features are available to draw.'),
      '#default_value' => isset($defaults['feature_types']) ? $defaults['feature_types'] : array(),
    ),
    'feature_limit' => array(
      '#title' => t('Number of features'),
      '#type' => 'textfield',
      '#description' => t('The number of features that are allowed to be
          drawn. Leave blank or at 0 for unlimited.'),
      '#default_value' => isset($defaults['feature_limit']) ? $defaults['feature_limit'] : 0,
    ),
    'element_id' => array(
      '#type' => 'textfield',
      '#default_value' => isset($defaults['element_id']) ? $defaults['element_id'] : '',
      '#title' => t('Element ID'),
      '#description' => t('The DOM element ID that will be passed the value of the features.  This will probably be a textfield or textarea.'),
    ),
  );
}