You are here

function openlayers_layer_load in Openlayers 6.2

Same name and namespace in other branches
  1. 7.2 openlayers.module \openlayers_layer_load()

Menu loader for layers. (%openlayers_layer)

Parameters

$name: Layer name

Return value

array Layer export

5 calls to openlayers_layer_load()
openlayers_behavior_cluster::options_form in includes/behaviors/openlayers_behavior_cluster.inc
Provide form for configurations per map.
openlayers_behavior_popup::options_form in includes/behaviors/openlayers_behavior_popup.inc
Form defintion for per map customizations.
openlayers_behavior_tooltip::options_form in includes/behaviors/openlayers_behavior_tooltip.inc
Form defintion for per map customizations.
openlayers_ui_layers_import_validate in modules/openlayers_ui/includes/openlayers_ui.layers.inc
Validate handler to import a preset
_openlayers_layers_process in includes/openlayers.render.inc
Initialize the layer array into an indexed array of layer objects

File

./openlayers.module, line 293
Main OpenLayers API File

Code

function openlayers_layer_load($name, $reset = FALSE) {
  ctools_include('export');
  if ($reset) {
    ctools_export_load_object_reset('openlayers_layers');
  }
  $layer = ctools_export_load_object('openlayers_layers', 'names', array(
    $name,
  ));
  if ($layer) {
    $layer_object = openlayers_get_layer_object($layer[$name]);
    if (openlayers_layer_sanity_check($layer_object)) {
      return $layer_object;
    }
  }
  else {
    watchdog('openlayers', 'Layer %layer not found.', array(
      '%layer' => $name,
    ), WATCHDOG_ERROR);
    return FALSE;
  }
}