function theme_openlayers_map in Openlayers 6
Same name and namespace in other branches
- 6.2 includes/openlayers.theme.inc \theme_openlayers_map()
Theme function for openlayers_map
1 theme call to theme_openlayers_map()
- openlayers_render_map in ./
openlayers.module - Render Map
File
- includes/
openlayers.theme.inc, line 13 - This file holds the theme functions for openlayers module
Code
function theme_openlayers_map($map = array()) {
// To ensure that any controls are on the map correctly, we need to
// wrap the map in a container, and take into account percentage dimensions
$container_width = $map['width'];
$container_height = $map['height'];
$map['width'] = strpos($map['width'], '%') > 0 ? '100%' : $map['width'];
$map['height'] = strpos($map['height'], '%') > 0 ? '100%' : $map['height'];
// Create output
$output = '
<div style="width: ' . $container_width . '; height: ' . $container_height . ';">
<div style="width: ' . $map['width'] . '; height: ' . $map['height'] . ';" id="' . $map['id'] . '" class="openlayers-map openlayers-preset-' . $map['preset_name'] . '"></div>
</div>
';
return $output;
}