You are here

function openlayers_features_export_render in Openlayers 6

Implementation of hook_features_export_render().

Parameters

$module_name The name of the module for which things are: being exported

$data An array of key/value data to export, in the form: array('presetname',... 'presetname2')

File

includes/openlayers.features.inc, line 44
OpenLayers Features Support

Code

function openlayers_features_export_render($module_name, $data) {
  $omit = array(
    'presetid',
    'storage',
  );
  $items = array();
  foreach ($data as $key) {
    $preset = openlayers_get_preset($key);
    foreach ($omit as $i) {
      unset($preset[$i]);
    }
    $items[$key] = $preset;
  }
  $code = "  \$items = " . features_var_export($items, '  ') . ";\n";
  $code .= '  return $items;';
  return array(
    'openlayers_presets' => $code,
  );
}