You are here

protected function GeoJson::getExcludedFields in Views GeoJSON 8

Retrieves the list of excluded fields due to style plugin configuration.

Return value

array List of excluded fields.

1 call to GeoJson::getExcludedFields()
GeoJson::render in src/Plugin/views/style/GeoJson.php
Render the display in this style.

File

src/Plugin/views/style/GeoJson.php, line 443

Class

GeoJson
Style plugin to render view as GeoJSON code.

Namespace

Drupal\views_geojson\Plugin\views\style

Code

protected function getExcludedFields() {
  $data_source = $this->options['data_source'];
  $excluded_fields = [
    $data_source['name_field'],
    $data_source['description_field'],
  ];
  switch ($data_source['value']) {
    case 'latlon':
      $excluded_fields[] = $data_source['latitude'];
      $excluded_fields[] = $data_source['longitude'];
      break;
    case 'geofield':
      $excluded_fields[] = $data_source['geofield'];
      break;
    case 'geolocation':
      $excluded_fields[] = $data_source['geolocation'];
      break;
    case 'wkt':
      $excluded_fields[] = $data_source['wkt'];
      break;
  }
  return array_combine($excluded_fields, $excluded_fields);
}