You are here

function hook_openlayers_maps in Openlayers 7.2

OpenLayers maps

Define map objects.

Return value

Return an associative array with index being a unique string identifier, and simple objects with the following properties:

  • "api_version":
  • "name":
  • "title":
  • "data":
3 functions implement hook_openlayers_maps()

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

openlayers_openlayers_maps in ./openlayers.module
Implements hook_openlayers_maps().
openlayers_test_example_feature_openlayers_maps in tests/features/openlayers_test_example_feature/openlayers_test_example_feature.openlayers_maps.inc
Implements hook_openlayers_maps().
openlayers_test_openlayers_maps in tests/openlayers_test.module
Implements hook_openlayers_maps().

File

docs/openlayers.api.php, line 248
Hooks provided by the OpenLayers suite of modules. This file allows hooks to be documented automatically with Doxygen, like on api.drupal.org.

Code

function hook_openlayers_maps() {

  // Taken from openlayers.maps.inc
  $default = new stdClass();
  $default->api_version = 1;
  $default->name = 'default';
  $default->title = t('Default Map');
  $default->description = t('This is the default map that comes with the OpenLayers module.');
  $default->data = array(
    'projection' => 'EPSG:900913',
    'displayProjection' => 'EPSG:4326',
    'width' => 'auto',
    'default_layer' => 'osm_mapnik',
    'height' => '400px',
    'center' => array(
      'initial' => array(
        'centerpoint' => '0,0',
        'zoom' => '2',
      ),
    ),
    'behaviors' => array(
      'openlayers_behavior_panzoombar' => array(),
      'openlayers_behavior_layerswitcher' => array(),
      'openlayers_behavior_attribution' => array(),
      'openlayers_behavior_keyboarddefaults' => array(),
      'openlayers_behavior_navigation' => array(),
    ),
    'layers' => array(
      'osm_mapnik' => 'osm_mapnik',
    ),
  );
  return array(
    'default' => $default,
  );
}