You are here

public static function LeafletTileLayerOverlay::addTileOverlaySettingsFormAjax in Geolocation Field 8.3

Return settings array for tile overlay after select change.

Parameters

array $form: Form.

\Drupal\Core\Form\FormStateInterface $form_state: Current From State.

Return value

\Drupal\Core\Ajax\AjaxResponse Settings form.

File

modules/geolocation_leaflet/src/Plugin/geolocation/MapFeature/LeafletTileLayerOverlay.php, line 73

Class

LeafletTileLayerOverlay
Provides map tile layer overlay support.

Namespace

Drupal\geolocation_leaflet\Plugin\geolocation\MapFeature

Code

public static function addTileOverlaySettingsFormAjax(array $form, FormStateInterface $form_state) {
  $ajax_response = new AjaxResponse();
  $triggering_element_value = $form_state
    ->getTriggeringElement()['#value'];
  $overlay = explode('.', $triggering_element_value)[0];
  $form = LeafletTileLayerOverlay::getOptionsForm($overlay);
  $ajax_response
    ->addCommand(new ReplaceCommand('#tile-overlay-settings', $form));
  return $ajax_response;
}