function openlayers_layers_load in Openlayers 6.2
Same name and namespace in other branches
- 7.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
4 calls to openlayers_layers_load()
- openlayers_test_openlayers_presets in tests/
openlayers_test.module - Implementation of hook_openlayers_presets().
- 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_ui_object_list in modules/
openlayers_ui/ openlayers_ui.module - Menu callback for Layers.
File
- ./
openlayers.module, line 319 - Main OpenLayers API File
Code
function openlayers_layers_load($reset = 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) {
$layer_objects[$layer->name] = openlayers_get_layer_object($layer);
}
$layer_objects = array_filter($layer_objects, 'openlayers_layer_sanity_check');
return $layer_objects;
}