openlayers-8.x-4.x-dev/src/Form/MapStyleEditForm.php
src/Form/MapStyleEditForm.php
<?php
namespace Drupal\openlayers\Form;
use Drupal\Core\Form\FormStateInterface;
use Drupal\openlayers\OpenlayersMapInterface;
//use Drupal\openlayers\OpenlayersLayerInterface;
/**
* Provides an edit form for image effects.
*
* @internal
*/
class MapStyleEditForm extends MapStyleFormBase {
/**
* {@inheritdoc}
*/
public function buildForm(array $form, FormStateInterface $form_state, OpenlayersMapInterface $map = NULL, $style = NULL) {
$form = parent::buildForm($form, $form_state, $map, $style);
$form['#title'] = $this->t('Edit %label style', ['%label' => $this->mapStyle->label()]);
$form['actions']['submit']['#value'] = $this->t('Update style');
return $form;
}
/**
* {@inheritdoc}
*/
protected function prepareOpenlayersStyle($style) {
/*
return $this->imageStyle->getEffect($image_effect); // EDIT FORM
*/
/*
$image_effect = $this->effectManager->createInstance($image_effect); // ADD FORM ?
// Set the initial weight so this effect comes last.
$image_effect->setWeight(count($this->imageStyle->getEffects()));
*/
return $style;
}
}
