You are here

function openlayers_layers_load in Openlayers 7.2

Same name and namespace in other branches
  1. 6.2 openlayers.module \openlayers_layers_load()

Get all openlayers layers as objects.

Parameters

$reset: Boolean whether to reset cache or not

Return value

array array of layer info

9 calls to openlayers_layers_load()
openlayers_maps_ui::list_build_row in modules/openlayers_ui/plugins/export_ui/openlayers_maps_ui.class.php
Build a row based on the item.
openlayers_ui_get_layer_options in modules/openlayers_ui/openlayers_ui.module
Get layer options.
openlayers_ui_get_projection_options in modules/openlayers_ui/openlayers_ui.module
Get projection options.
openlayers_update_7204 in ./openlayers.install
Rename the 'baselayer' in 'isBaseLayer' in layers.
openlayers_update_7206 in ./openlayers.install
Rename the 'base_url' in 'url' in layer type TMS.

... See full list

File

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

Code

function openlayers_layers_load($reset = FALSE, $include_disabled = FALSE) {
  ctools_include('export');
  $layer_objects = array();
  if ($reset) {
    ctools_export_load_object_reset('openlayers_layers');
  }
  $layers = ctools_export_load_object('openlayers_layers', 'all', array());
  foreach ($layers as $layer) {
    if (!$include_disabled && isset($layer->disabled) && $layer->disabled) {
      continue;
    }
    $layer_objects[$layer->name] = openlayers_get_layer_object($layer);
  }
  return array_filter($layer_objects, 'openlayers_layer_sanity_check');
}