You are here

class Geolocation in Geolocation Field 8.3

Same name in this branch
  1. 8.3 src/Feeds/Target/Geolocation.php \Drupal\geolocation\Feeds\Target\Geolocation
  2. 8.3 src/Plugin/Geocoder/Field/Geolocation.php \Drupal\geolocation\Plugin\Geocoder\Field\Geolocation
Same name and namespace in other branches
  1. 8 src/Plugin/Geocoder/Field/Geolocation.php \Drupal\geolocation\Plugin\Geocoder\Field\Geolocation
  2. 8.2 src/Plugin/Geocoder/Field/Geolocation.php \Drupal\geolocation\Plugin\Geocoder\Field\Geolocation

Provides a geolocation geocoder field plugin.

Plugin annotation


@GeocoderField(
  id = "geolocation",
  label = @Translation("Geolocation field plugin"),
  field_types = {
    "geolocation"
  }
)

Hierarchy

  • class \Drupal\geolocation\Plugin\Geocoder\Field\Geolocation extends \Drupal\geocoder_field\Plugin\Geocoder\Field\DefaultField

Expanded class hierarchy of Geolocation

27 string references to 'Geolocation'
geolocation.info.yml in ./geolocation.info.yml
geolocation.info.yml
geolocation_address.info.yml in modules/geolocation_address/geolocation_address.info.yml
modules/geolocation_address/geolocation_address.info.yml
geolocation_baidu.info.yml in modules/geolocation_baidu/geolocation_baidu.info.yml
modules/geolocation_baidu/geolocation_baidu.info.yml
geolocation_demo.info.yml in modules/geolocation_demo/geolocation_demo.info.yml
modules/geolocation_demo/geolocation_demo.info.yml
geolocation_geocodio.info.yml in modules/geolocation_geocodio/geolocation_geocodio.info.yml
modules/geolocation_geocodio/geolocation_geocodio.info.yml

... See full list

File

src/Plugin/Geocoder/Field/Geolocation.php, line 20

Namespace

Drupal\geolocation\Plugin\Geocoder\Field
View source
class Geolocation extends DefaultField {

  /**
   * {@inheritdoc}
   */
  public function getSettingsForm(FieldConfigInterface $field, array $form, FormStateInterface &$form_state) {
    $element = parent::getSettingsForm($field, $form, $form_state);

    // Hard-wire the dumper for geolocation fields, but make multiple
    // geolocation dumpers possible.
    $options = $element['dumper']['#options'];
    foreach ($options as $key => $option) {
      if (strpos($key, 'geolocation') !== 0) {
        unset($options[$key]);
      }
    }
    $element['dumper']['#options'] = $options;
    return $element;
  }

}

Members