You are here

protected function IpGeoLocPluginStyleOpenLayers::defineOptions in IP Geolocation Views & Maps 8

Set default Leaflet options.

Overrides StylePluginBase::defineOptions

File

src/Plugin/views/style/IpGeoLocPluginStyleOpenLayers.php, line 68

Class

IpGeoLocPluginStyleOpenLayers
Views Style plugin extension for OpenLayers (if enabled).

Namespace

Drupal\ip_geoloc\Plugin\views\style

Code

protected function defineOptions() {
  $options = parent::defineOptions();
  $latitude = $this->moduleHandler
    ->moduleExists('location') ? 'location_latitude' : 'ip_geoloc_latitude';

  // For field-based modules.
  $longitude = $this->moduleHandler
    ->moduleExists('location') ? 'location_longitude' : ($latitude == 'ip_geoloc_latitude' ? 'ip_geoloc_longitude' : $latitude);
  $options['ip_geoloc_views_plugin_latitude'] = [
    'default' => $latitude,
  ];
  $options['ip_geoloc_views_plugin_longitude'] = [
    'default' => $longitude,
  ];
  $options['differentiator'] = [
    'contains' => [
      'differentiator_field' => [
        'default' => '',
      ],
    ],
  ];
  $options['default_marker_color'] = [
    'default' => '',
  ];
  $options['center_option'] = [
    'default' => IP_GEOLOC_MAP_CENTER_ON_FIRST_LOCATION,
  ];
  $options['argument'] = [
    'default' => '',
  ];
  return $options;
}