public static function LeafletWidget::defaultSettings in Leaflet Widget for Geofield 8
Defines the default settings for this plugin.
Return value
array A list of default settings, keyed by the setting name.
Overrides GeofieldDefaultWidget::defaultSettings
File
- src/
Plugin/ Field/ FieldWidget/ LeafletWidget.php, line 88
Class
- LeafletWidget
- Plugin implementation of the "leaflet_widget" widget.
Namespace
Drupal\leaflet_widget\Plugin\Field\FieldWidgetCode
public static function defaultSettings() {
$base_layers = self::getLeafletMaps();
return parent::defaultSettings() + [
'map' => [
'leaflet_map' => array_shift($base_layers),
'height' => 300,
'center' => [
'lat' => 0.0,
'lng' => 0.0,
],
'auto_center' => TRUE,
'zoom' => 10,
],
'input' => [
'show' => TRUE,
'readonly' => FALSE,
],
];
}