Rename farm_map_wkt element to farm_map_input.
This commit is contained in:
parent
26c9746681
commit
36cc27bbf1
|
@ -8,9 +8,9 @@ use Drupal\Core\Render\Element\FormElement;
|
|||
/**
|
||||
* Form element that returns WKT rendered in a map.
|
||||
*
|
||||
* @FormElement("farm_map_wkt")
|
||||
* @FormElement("farm_map_input")
|
||||
*/
|
||||
class FarmMapWkt extends FormElement {
|
||||
class FarmMapInput extends FormElement {
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
|
@ -41,7 +41,7 @@ class FarmMapWkt extends FormElement {
|
|||
}
|
||||
|
||||
/**
|
||||
* Generates the FarmMapWktform element.
|
||||
* Generates the form element.
|
||||
*
|
||||
* @param array $element
|
||||
* An associative array containing the properties and children of the
|
|
@ -133,8 +133,8 @@ class GeofieldWidget extends GeofieldBaseWidget {
|
|||
*/
|
||||
public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, FormStateInterface $form_state) {
|
||||
|
||||
// Use the farm_map_wkt form element.
|
||||
$element['#type'] = 'farm_map_wkt';
|
||||
// Use the farm_map_input form element.
|
||||
$element['#type'] = 'farm_map_input';
|
||||
|
||||
// Wrap the map with a unique id for populating from files.
|
||||
$field_name = $this->fieldDefinition->getName();
|
||||
|
|
|
@ -30,7 +30,7 @@ class Test extends QuickFormBase {
|
|||
|
||||
// Geometry field with a default value and no raw data textfield.
|
||||
$form['geometry1'] = [
|
||||
'#type' => 'farm_map_wkt',
|
||||
'#type' => 'farm_map_input',
|
||||
'#title' => $this->t('Geometry 1'),
|
||||
'#display_raw_geometry' => FALSE,
|
||||
'#default_value' => 'POINT(-42.689862437640826 32.621823310499934)',
|
||||
|
@ -38,7 +38,7 @@ class Test extends QuickFormBase {
|
|||
|
||||
// Geometry field without a default value and a raw data field.
|
||||
$form['geometry2'] = [
|
||||
'#type' => 'farm_map_wkt',
|
||||
'#type' => 'farm_map_input',
|
||||
'#title' => $this->t('Geometry 2'),
|
||||
'#display_raw_geometry' => TRUE,
|
||||
];
|
||||
|
|
Loading…
Reference in New Issue