You are here

protected function CivicrmEntityAddressLeafletMap::defineOptions in CiviCRM Entity 8.3

Set default options.

Overrides LeafletMap::defineOptions

File

modules/civicrm_entity_leaflet/src/Plugin/views/style/CivicrmEntityAddressLeafletMap.php, line 520

Class

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

Namespace

Drupal\civicrm_entity_leaflet\Plugin\views\style

Code

protected function defineOptions() {
  $options = parent::defineOptions();
  $options['data_source_lat'] = [
    'default' => '',
  ];
  $options['data_source_lon'] = [
    '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;
}