You are here

function openlayers_behavior_zoomtolayer::options_form in Openlayers 7.2

Same name and namespace in other branches
  1. 6.2 includes/behaviors/openlayers_behavior_zoomtolayer.inc \openlayers_behavior_zoomtolayer::options_form()

Overrides openlayers_behavior::options_form

File

plugins/behaviors/openlayers_behavior_zoomtolayer.inc, line 21
Implementation of OpenLayers behavior.

Class

openlayers_behavior_zoomtolayer
Zoom To Layer Behavior

Code

function options_form($defaults = array()) {
  return array(
    'zoomtolayer' => array(
      '#type' => 'checkboxes',
      '#options' => $this->map['layers'],
      '#description' => t('Select layer(s) to which to zoom when the map is loaded.'),
      '#default_value' => isset($defaults['zoomtolayer']) ? $defaults['zoomtolayer'] : array(),
    ),
    'point_zoom_level' => array(
      '#title' => t('Point Zoom Level'),
      '#type' => 'textfield',
      '#default_value' => isset($defaults['point_zoom_level']) ? $defaults['point_zoom_level'] : 5,
      '#size' => 5,
    ),
    'zoomtolayer_scale' => array(
      '#title' => t('Zoom to Layer Scale'),
      '#type' => 'textfield',
      '#size' => 5,
      '#description' => t('Additional scaling to apply to the calculated bounds before zooming.  See <a href="http://dev.openlayers.org/docs/files/OpenLayers/BaseTypes/Bounds-js.html#OpenLayers.Bounds.scale">OpenLayers docs</a>.'),
      '#default_value' => isset($defaults['zoomtolayer_scale']) ? $defaults['zoomtolayer_scale'] : 1,
    ),
  );
}