You are here

protected function LeafletMap::defineOptions in Leaflet 2.0.x

Same name and namespace in other branches
  1. 8 modules/leaflet_views/src/Plugin/views/style/LeafletMap.php \Drupal\leaflet_views\Plugin\views\style\LeafletMap::defineOptions()
  2. 2.1.x modules/leaflet_views/src/Plugin/views/style/LeafletMap.php \Drupal\leaflet_views\Plugin\views\style\LeafletMap::defineOptions()

Set default options.

Overrides StylePluginBase::defineOptions

File

modules/leaflet_views/src/Plugin/views/style/LeafletMap.php, line 948

Class

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

Namespace

Drupal\leaflet_views\Plugin\views\style

Code

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