You are here

function openlayers_preset_load in Openlayers 6.2

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

Given a preset name, get full preset object.

This function can also be used as a menu loader for a style.

Parameters

$name: String identifier of the preset.

$reset: Boolean whether to reset cache.

Return value

Preset object or FALSE if not found.

8 calls to openlayers_preset_load()
openlayers_build_map in ./openlayers.module
Prepare a map for rendering.
openlayers_filters_filter in modules/openlayers_filters/openlayers_filters.module
Implementation of hook_filter().
openlayers_ui_import_validate in modules/openlayers_ui/openlayers_ui.module
Validate handler to import a preset
openlayers_ui_presets_form in modules/openlayers_ui/includes/openlayers_ui.presets.inc
Menu Callback for Add Preset
openlayers_ui_presets_form_validate in modules/openlayers_ui/includes/openlayers_ui.presets.inc
OpenLayers Preset Form Validate

... See full list

File

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

Code

function openlayers_preset_load($name = '', $reset = FALSE) {
  ctools_include('export');
  if ($reset) {
    ctools_export_load_object_reset('openlayers_map_presets');
  }
  $presets = ctools_export_load_object('openlayers_map_presets', 'names', array(
    $name,
  ));
  if (empty($presets[$name])) {
    return FALSE;
  }
  else {
    $preset = $presets[$name];
    $preset->data['preset_name'] = $name;
    return $preset;
  }
}