function openlayers_process_styles in Openlayers 6
Process Styles
Call back to process styles provided by the openlayers_openlayers_styles_info() function
Parameters
$style: String ID for the style
$map: Array of current map being processed
Return value
Array formated for an OpenLayers map style
2 string references to 'openlayers_process_styles'
- hook_openlayers_styles_info in docs/
openlayers.api.php - OpenLayers Style Info
- openlayers_openlayers_styles_info in ./
openlayers.module - Implementation of hook_openlayers_styles_info().
File
- includes/
openlayers.styles.inc, line 23 - This file contains styles instances used for defaults
Code
function openlayers_process_styles($style = NULL, $map = array()) {
$style_data = array();
// Make sure layer is a string
if (!is_string($style)) {
return FALSE;
}
// Determine what data to send back
switch ($style) {
case 'default':
$style_data = array(
'pointRadius' => 5,
'fillColor' => '#FFCC66',
'strokeColor' => '#FF9933',
'strokeWidth' => 2,
'fillOpacity' => 0.5,
);
break;
case 'default_select':
$style_data = array(
'pointRadius' => 5,
'fillColor' => '#66CCFF',
'strokeColor' => '#3399FF',
'strokeWidth' => 2,
'fillOpacity' => 0.5,
);
break;
}
return $style_data;
}