function openlayers_openlayers_presets in Openlayers 6
Same name and namespace in other branches
- 6.2 openlayers.module \openlayers_openlayers_presets()
Implementation of hook_openlayers_presets().
File
- ./
openlayers.module, line 741 - Main OpenLayers API File
Code
function openlayers_openlayers_presets() {
$presets = array();
// Create map array
$default_map = array(
'projection' => '4326',
'width' => 'auto',
'default_layer' => 'openlayers_default_wms',
'height' => '300px',
'center' => array(
'lat' => '0',
'lon' => '0',
'zoom' => '2',
),
'options' => array(
'displayProjection' => '4326',
),
'controls' => array(
'LayerSwitcher' => TRUE,
'Navigation' => TRUE,
'PanZoomBar' => TRUE,
'MousePosition' => TRUE,
),
);
// Create full preset array
$presets['default'] = array(
'preset_name' => 'default',
'preset_title' => t('Default Map'),
'preset_description' => t('This is the default map preset that comes with the OpenLayers module.'),
'preset_data' => $default_map,
);
return $presets;
}