You are here

public function RegularShape::optionsFormSubmit in Openlayers 7.3

Submit callback for the options form.

Parameters

array $form: The form array.

array $form_state: The form_state array by reference.

Overrides Base::optionsFormSubmit

File

src/Plugin/Style/RegularShape/RegularShape.php, line 279
Style: RegularShape.

Class

RegularShape
Class RegularShape.

Namespace

Drupal\openlayers\Plugin\Style\RegularShape

Code

public function optionsFormSubmit(array $form, array &$form_state) {
  parent::optionsFormSubmit($form, $form_state);
  $options = $this
    ->getOptions();
  foreach (Openlayers::getGeometryTypes() as $geometry_type => $geometry) {
    if ((bool) $options[$geometry_type]['enabled'] === FALSE) {
      unset($options[$geometry_type]);
    }
  }
  $this
    ->setOptions($options);
  $form_state['values']['options'] = $options;
  parent::optionsFormSubmit($form, $form_state);
}