function openlayers_behaviors_process_declutter in Openlayers 6
Callback for OpenLayers Behaviors (De-clutter)
Parameters
$behavior: Data about behavior
$map: Map array
Return value
Behavior array or FALSE if not valid
1 string reference to 'openlayers_behaviors_process_declutter'
- openlayers_behaviors_openlayers_behaviors_info in modules/
openlayers_behaviors/ openlayers_behaviors.module - Implementation of hook_openlayers_behaviors_info().
File
- modules/
openlayers_behaviors/ includes/ openlayers_behaviors.behaviors.inc, line 186 - This file holds the main Drupal hook functions and private functions for the openlayers_behaviors module.
Code
function openlayers_behaviors_process_declutter($behavior, &$map) {
if ($behavior['layer'] && $map['layers'][$behavior['layer']]) {
// Add Events to map
$map['events'] = $map['events'] ? $map['events'] : array();
$map['events']['zoomend'] = $map['events']['zoomend'] ? $map['events']['zoomend'] : array();
$map['events']['zoomend'][] = 'declutterZoomEnd';
// @@TODO: Add Events to layer (features added + removed)
return $behavior;
}
return FALSE;
}