You are here

function openlayers_element_process_callback in Openlayers 7.3

Process callback for the openlayers form element.

Renders the map and returns the markup in an renderable array.

1 string reference to 'openlayers_element_process_callback'
openlayers_element_info in ./openlayers.module
Implements hook_element_info().

File

./openlayers.module, line 49
Openlayers module.

Code

function openlayers_element_process_callback($element, $form_state, $complete_form) {

  /* @var \Drupal\openlayers\Types\MapInterface $map */
  if (($map = \Drupal\openlayers\Openlayers::load('Map', $element['#map'])) == TRUE) {
    $element['map'] = $map
      ->build();
  }
  return $element;
}