1. openlayers
    1. DRUPAL-7--2
DRUPAL-7--2 openlayers_example_ctools_plugin_api($module, $api)

CTools Registration Hook


In order to support styles, presets, and layers in an external module, one must notify the CTools module that that module provides implementations of the hooks for styles, presets, and/or layers.

This function is just an example implementation of hook_ctools_plugin_api() and should be alter according to your module's name.


$module Name of a module that supports CTools exportables.

$api Name of the kind of exportable supported.

Return value

If $module is 'openlayers', and $api is a type of exportable that your module provides, and you are using Openlayers 2.x, then return array with the following values:

  • version => 1


docs/openlayers.api.php, line 98

function openlayers_example_ctools_plugin_api($module, $api) {
  if ($module == "openlayers") {
    switch ($api) {
      case 'openlayers_presets':
        return array('version' => 1);

      case 'openlayers_layers':
        return array('version' => 1);

      case 'openlayers_styles':
        return array('version' => 1);