function openlayers_ui_get_layer_type_options in Openlayers 6.2
Get layer type options.
1 call to openlayers_ui_get_layer_type_options()
- openlayers_ui_layers_types in modules/
openlayers_ui/ includes/ openlayers_ui.layers.inc - Layer add/edit form.
File
- modules/
openlayers_ui/ includes/ openlayers_ui.layers.inc, line 151 - This file holds the functions handling layers in the Openlayers UI.
Code
function openlayers_ui_get_layer_type_options($type) {
$form = array();
$form['layer_type_help'] = array(
'#type' => 'item',
'#value' => t('Select a layer type to create a new layer.'),
);
foreach (openlayers_layer_types() as $key => $plugin) {
$class = ctools_plugin_get_class($plugin, 'layer_type');
if ($class) {
// Build form.
$form[$key] = array(
'#type' => 'item',
'#title' => l($plugin['title'], "admin/build/openlayers/layers/add/{$key}"),
'#value' => $plugin['description'],
);
}
}
return $form;
}