You are here

protected function GeofieldGoogleMapViewStyle::defineOptions in Geofield Map 8

Same name and namespace in other branches
  1. 8.2 src/Plugin/views/style/GeofieldGoogleMapViewStyle.php \Drupal\geofield_map\Plugin\views\style\GeofieldGoogleMapViewStyle::defineOptions()

Set default options.

Overrides StylePluginBase::defineOptions

1 call to GeofieldGoogleMapViewStyle::defineOptions()
GeofieldGoogleMapViewStyle::buildOptionsForm in src/Plugin/views/style/GeofieldGoogleMapViewStyle.php
Provide a form to edit options for this plugin.

File

src/Plugin/views/style/GeofieldGoogleMapViewStyle.php, line 452

Class

GeofieldGoogleMapViewStyle
Style plugin to render a View output as a Leaflet map.

Namespace

Drupal\geofield_map\Plugin\views\style

Code

protected function defineOptions() {
  $options = parent::defineOptions();
  $options['data_source'] = [
    'default' => '',
  ];
  $options['name_field'] = [
    'default' => '',
  ];
  $options['description_field'] = [
    'default' => '',
  ];
  $options['view_mode'] = [
    'default' => 'full',
  ];
  $geofield_google_map_default_settings = [];
  foreach (self::getDefaultSettings() as $k => $setting) {
    $geofield_google_map_default_settings[$k] = [
      'default' => $setting,
    ];
  }
  return $options + $geofield_google_map_default_settings;
}