public function MapLayerDeleteForm::submitForm in Openlayers 8.4
Form submission handler.
Parameters
array $form: An associative array containing the structure of the form.
\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.
Overrides FormInterface::submitForm
File
- src/
Form/ MapLayerDeleteForm.php, line 73
Class
- MapLayerDeleteForm
- Form for deleting a layer from a map.
Namespace
Drupal\openlayers\FormCode
public function submitForm(array &$form, FormStateInterface $form_state) {
$this->olMap
->deleteMapLayer($this->mapLayer);
$this->olMap
->save();
$this
->messenger()
->addStatus($this
->t('The layer %name has been deleted from the map.', [
'%name' => $this->mapLayer
->label(),
]));
$form_state
->setRedirectUrl($this->olMap
->toUrl('edit-form'));
}