You are here

class openlayers_behavior_zoomtolayer in Openlayers 6.2

Same name and namespace in other branches
  1. 7.2 plugins/behaviors/openlayers_behavior_zoomtolayer.inc \openlayers_behavior_zoomtolayer

Attribution Behavior

Hierarchy

Expanded class hierarchy of openlayers_behavior_zoomtolayer

2 string references to 'openlayers_behavior_zoomtolayer'
openlayers_cck_widget_settings in modules/openlayers_cck/openlayers_cck.module
Implementation of hook_widget_settings().
_openlayers_openlayers_behaviors in includes/openlayers.behaviors.inc
Implementation of hook_openlayers_behaviors().

File

includes/behaviors/openlayers_behavior_zoomtolayer.inc, line 11
Implementation of OpenLayers behavior.

View source
class openlayers_behavior_zoomtolayer extends openlayers_behavior {

  /**
   * Provide initial values for options.
   */
  function options_init() {
    return array(
      'point_zoom_level' => '5',
    );
  }
  function options_form($defaults) {
    return array(
      'zoomtolayer' => array(
        '#type' => 'select',
        '#options' => $this->map['layers'],
        '#description' => t('Select layer to zoom to when the map is loaded'),
        '#default_value' => isset($defaults['zoomtolayer']) ? $defaults['zoomtolayer'] : NULL,
      ),
      'point_zoom_level' => array(
        '#type' => 'textfield',
        '#default_value' => isset($defaults['point_zoom_level']) ? $defaults['point_zoom_level'] : 5,
        '#size' => 5,
        '#title' => t('Point Zoom Level'),
      ),
    );
  }

  /**
   * Render.
   */
  function render(&$map) {
    drupal_add_js(drupal_get_path('module', 'openlayers') . '/includes/behaviors/js/openlayers_behavior_zoomtolayer.js');
    return $this->options;
  }

}

Members