function hook_openlayers_layers_handler_info in Openlayers 6
OpenLayers Layer Handler Info
Provides information on layer handlers. Every layer needs to have a valid type (layer handler).
Parameters
$map: Map array of map being rendered
Return value
Return a nested associative array with the top level being a unique string identifier key which corresponds to the layers' types. The next level being an array of key/value pairs:
- "layer_handler": This is the JS callback name that will belong to OL.Layers object.
 - "js_file": The JS file to include to look for the callback.
 
2 functions implement hook_openlayers_layers_handler_info()
Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.
- openlayers_layers_openlayers_layers_handler_info in modules/
openlayers_layers/ openlayers_layers.module  - Implementation of hook_openlayers_layers_handler().
 - openlayers_openlayers_layers_handler_info in ./
openlayers.module  - Implementation of hook_openlayers_layers_handler_info().
 
1 invocation of hook_openlayers_layers_handler_info()
- _openlayers_layers_process in includes/
openlayers.render.inc  - Process Layers
 
File
- docs/
openlayers.api.php, line 59  - Hooks provided by the OpenLayers suite of modules.
 
Code
function hook_openlayers_layers_handler_info($map = array()) {
  // Take from openlayers.module
  return array(
    'WMS' => array(
      'layer_handler' => 'WMS',
      'js_file' => drupal_get_path('module', 'openlayers') . '/js/openlayers.layers.js',
    ),
    'Vector' => array(
      'layer_handler' => 'Vector',
      'js_file' => drupal_get_path('module', 'openlayers') . '/js/openlayers.layers.js',
    ),
  );
}