You are here

public function LeafletGeojson::blockSubmit in Leaflet GeoJSON 8

Submit handler just puts non-empty values into configuration.

Overrides BlockPluginTrait::blockSubmit

File

src/Plugin/Block/LeafletGeojson.php, line 253

Class

LeafletGeojson
Provides a 'Leaflet Geojson' Block.

Namespace

Drupal\leaflet_geojson\Plugin\Block

Code

public function blockSubmit($form, FormStateInterface $form_state) {
  foreach ($form['settings']['map_settings'] as $key => $content) {

    // The override_zoom_center property could be empty, we want to track it.
    if (!empty($form_state
      ->getValue([
      'map_settings',
      $key,
    ])) || $key == 'override_zoom_center') {
      $this->configuration['map_settings'][$key] = $form_state
        ->getValue([
        'map_settings',
        $key,
      ]);
    }
  }
}