protected function IpGeoLocPluginStyleMap::defineOptions in IP Geolocation Views & Maps 8
Same name in this branch
- 8 src/Plugin/views/argument/IpGeoLocPluginArgDefaultIPGeoLoc.php \Drupal\ip_geoloc\Plugin\views\argument\IpGeoLocPluginStyleMap::defineOptions()
- 8 src/Plugin/views/style/IpGeoLocPluginStyleMap.php \Drupal\ip_geoloc\Plugin\views\style\IpGeoLocPluginStyleMap::defineOptions()
Set default Leaflet options.
Overrides StylePluginBase::defineOptions
File
- src/
Plugin/ views/ style/ IpGeoLocPluginStyleMap.php, line 81
Class
- IpGeoLocPluginStyleMap
- Views Style plugin extension for Map.
Namespace
Drupal\ip_geoloc\Plugin\views\styleCode
protected function defineOptions() {
$options = parent::defineOptions();
$latitude = $this->module_handler
->moduleExists('location') ? 'location_latitude' : 'ip_geoloc_latitude';
// For field-based modules.
$longitude = $this->module_handler
->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' => '<none>',
];
$options['center_option'] = [
'default' => IP_GEOLOC_MAP_CENTER_ON_FIRST_LOCATION,
];
$options['visitor_marker'] = [
'default' => '<none>',
];
$options['gps_roles'] = [
'default' => [
DRUPAL_ANONYMOUS_RID => DRUPAL_ANONYMOUS_RID,
DRUPAL_AUTHENTICATED_RID => DRUPAL_AUTHENTICATED_RID,
],
];
$options['map_options'] = [
'default' => '',
];
$options['map_div_style'] = [
'default' => '',
];
$options['empty_map_center'] = [
'default' => '',
];
return $options;
}