You are here

public static function GeofieldGoogleMapViewStyle::optionsFormEntitySourceSubmit in Geofield Map 8.2

Submit to update the data source.

Parameters

array $form: The Form.

\Drupal\Core\Form\FormStateInterface $form_state: The Form state.

File

src/Plugin/views/style/GeofieldGoogleMapViewStyle.php, line 747

Class

GeofieldGoogleMapViewStyle
Style plugin to render a View output as a Leaflet map.

Namespace

Drupal\geofield_map\Plugin\views\style

Code

public static function optionsFormEntitySourceSubmit(array $form, FormStateInterface $form_state) {
  $parents = $form_state
    ->getTriggeringElement()['#parents'];
  array_pop($parents);
  array_push($parents, 'entity_source');

  // Set the data source selected in the form state and rebuild the form.
  $form_state
    ->set('entity_source', $form_state
    ->getValue($parents));
  $form_state
    ->setRebuild(TRUE);
}