GeocodeFormatter.php in Geocoder 8.2
File
modules/geocoder_field/src/Plugin/Field/FieldFormatter/GeocodeFormatter.php
View source
<?php
namespace Drupal\geocoder_field\Plugin\Field\FieldFormatter;
use Drupal\geocoder_field\Plugin\Field\GeocodeFormatterBase;
use Drupal\Core\Form\FormStateInterface;
class GeocodeFormatter extends GeocodeFormatterBase {
protected $incompatiblePlugins = [
'file',
'gpxfile',
'kmlfile',
'geojsonfile',
];
public function settingsForm(array $form, FormStateInterface $form_state) {
$element = parent::settingsForm($form, $form_state);
$element['plugins'] = array_filter($element['plugins'], function ($e) {
return !in_array($e, $this->incompatiblePlugins);
}, ARRAY_FILTER_USE_KEY);
return $element;
}
}