class openlayers_plus_behavior_popup in OpenLayers Plus 7
Same name and namespace in other branches
- 7.3 behaviors/openlayers_plus_behavior_popup.inc \Openlayers_plus_behavior_popup
- 7.2 behaviors/openlayers_plus_behavior_popup.inc \Openlayers_plus_behavior_popup
Hierarchy
- class \openlayers_behavior
Expanded class hierarchy of openlayers_plus_behavior_popup
1 string reference to 'openlayers_plus_behavior_popup'
- openlayers_plus_openlayers_behaviors in ./
openlayers_plus.module - Implements hook_openlayers_behaviors().
File
- behaviors/
openlayers_plus_behavior_popup.inc, line 3
View source
class openlayers_plus_behavior_popup extends openlayers_behavior {
/**
* Provide initial values for options.
*/
function options_init() {
return array(
'layers' => array(),
);
}
/**
* Form defintion for per map customizations.
*/
function options_form($defaults = array()) {
// 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(),
),
);
}
/**
* Render.
*/
function render(&$map) {
drupal_add_css(drupal_get_path('module', 'openlayers_plus') . '/behaviors/openlayers_plus_behavior_popup.css');
drupal_add_js(drupal_get_path('module', 'openlayers_plus') . '/behaviors/openlayers_plus_behavior_popup.js');
return $this->options;
}
}
Members
Name![]() |
Modifiers | Type | Description | Overrides |
---|---|---|---|---|
openlayers_behavior:: |
property | |||
openlayers_behavior:: |
function | 17 | ||
openlayers_behavior:: |
function | |||
openlayers_plus_behavior_popup:: |
function |
Form defintion for per map customizations. Overrides openlayers_behavior:: |
||
openlayers_plus_behavior_popup:: |
function |
Provide initial values for options. Overrides openlayers_behavior:: |
||
openlayers_plus_behavior_popup:: |
function |
Render. Overrides openlayers_behavior:: |