You are here

function openlayers_map_layerlist in Openlayers 7.2

Rerenders form part “Layers & Styles” when map projections changes

_state

Parameters

array $form:

Return value

array Form part to rerender

1 string reference to 'openlayers_map_layerlist'
openlayers_maps_ui::edit_form in modules/openlayers_ui/plugins/export_ui/openlayers_maps_ui.class.php
Provide the actual editing form.

File

./openlayers.module, line 1101
Main OpenLayers API File

Code

function openlayers_map_layerlist(&$form, &$form_state) {
  module_load_include('inc', 'openlayers_ui', '/include/openlayers_ui.theme');

  // Remove group property as Drupal otherwise returns NULL instead of the rendered form part
  unset($form['layerstyles']['#group']);

  // Force a diffent, fixed identifier so that the form part can reliably replaced
  $form['layerstyles']['#id'] = 'edit-layerstyles';

  // Rerender the form part
  return $form['layerstyles'];
}