You are here

function hook_openlayers_styles_info in Openlayers 6

OpenLayers Style Info

This hook tells OpenLayers about the available styles that can be used by name in maps. These will show up in the Preset UI.

Return value

Return a nested associative array with the top level being a unique string identifier, and the nested array containing the following key/pairs:

  • "name": Translated name of the style.
  • "description": Translated description.
  • "file": The Drupal path for where the PHP callback is stored
  • "callback": The name of the PHP function that will be called when the behavior is rendered
1 function implements hook_openlayers_styles_info()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

openlayers_openlayers_styles_info in ./openlayers.module
Implementation of hook_openlayers_styles_info().
1 invocation of hook_openlayers_styles_info()
openlayers_styles_get_info in ./openlayers.module
Get Styles Info

File

docs/openlayers.api.php, line 170
Hooks provided by the OpenLayers suite of modules.

Code

function hook_openlayers_styles_info() {

  // Taken from openlayers.module
  // Define info array
  $info['default'] = array(
    'name' => t('Default Style'),
    'description' => t('Basic default style.'),
    'file' => drupal_get_path('module', 'openlayers') . '/includes/openlayers.styles.inc',
    'callback' => 'openlayers_process_styles',
  );
  $info['default_select'] = array(
    'name' => t('Default Select Style'),
    'description' => t('Default style for selected geometries'),
    'file' => drupal_get_path('module', 'openlayers') . '/includes/openlayers.styles.inc',
    'callback' => 'openlayers_process_styles',
  );
  return $info;
}