Geolocation.php in Geolocation Field 8.3
File
src/Plugin/Geocoder/Field/Geolocation.php
View source
<?php
namespace Drupal\geolocation\Plugin\Geocoder\Field;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Field\FieldConfigInterface;
use Drupal\geocoder_field\Plugin\Geocoder\Field\DefaultField;
class Geolocation extends DefaultField {
public function getSettingsForm(FieldConfigInterface $field, array $form, FormStateInterface &$form_state) {
$element = parent::getSettingsForm($field, $form, $form_state);
$options = $element['dumper']['#options'];
foreach ($options as $key => $option) {
if (strpos($key, 'geolocation') !== 0) {
unset($options[$key]);
}
}
$element['dumper']['#options'] = $options;
return $element;
}
}