You are here

function _openlayers_behaviors_render in Openlayers 7.2

Same name and namespace in other branches
  1. 6.2 includes/openlayers.render.inc \_openlayers_behaviors_render()

Execute render() method for all enabled behaviors.

Parameters

$behaviors: Array of behaviors to process

$map: Map array

Return value

$rendered Indexed array of rendered behaviors

1 call to _openlayers_behaviors_render()
openlayers_build_map in ./openlayers.module
Prepare a map for rendering.

File

includes/openlayers.render.inc, line 74
Processing functions for layers and behaviors

Code

function _openlayers_behaviors_render($behaviors = array(), &$map = array()) {
  $rendered = array();
  foreach (openlayers_behaviors() as $key => $plugin) {
    if (isset($behaviors[$key]) && ($class = ctools_plugin_get_class($plugin, 'behavior'))) {
      $behavior = new $class($behaviors[$key], $map);
      $rendered[$key] = $behavior
        ->render($map);
    }
  }
  return $rendered;
}