You are here

public static function LeafletDefaultWidget::defaultSettings in Leaflet 2.1.x

Same name and namespace in other branches
  1. 8 src/Plugin/Field/FieldWidget/LeafletDefaultWidget.php \Drupal\leaflet\Plugin\Field\FieldWidget\LeafletDefaultWidget::defaultSettings()
  2. 2.0.x src/Plugin/Field/FieldWidget/LeafletDefaultWidget.php \Drupal\leaflet\Plugin\Field\FieldWidget\LeafletDefaultWidget::defaultSettings()
2 calls to LeafletDefaultWidget::defaultSettings()
LeafletDefaultWidget::formElement in src/Plugin/Field/FieldWidget/LeafletDefaultWidget.php
LeafletDefaultWidget::settingsForm in src/Plugin/Field/FieldWidget/LeafletDefaultWidget.php

File

src/Plugin/Field/FieldWidget/LeafletDefaultWidget.php, line 155

Class

LeafletDefaultWidget
Plugin implementation of the "leaflet_widget" widget.

Namespace

Drupal\leaflet\Plugin\Field\FieldWidget

Code

public static function defaultSettings() {
  $base_layers = self::getLeafletMaps();
  return [
    'map' => [
      'leaflet_map' => array_shift($base_layers),
      'height' => 400,
      'auto_center' => TRUE,
      'map_position' => self::getDefaultSettings()['map_position'],
      'locate' => TRUE,
      'scroll_zoom_enabled' => TRUE,
      'fullscreen_control' => TRUE,
    ],
    'input' => [
      'show' => TRUE,
      'readonly' => FALSE,
    ],
    'toolbar' => [
      'position' => 'topright',
      'marker' => 'defaultMarker',
      'drawPolyline' => TRUE,
      'drawRectangle' => TRUE,
      'drawPolygon' => TRUE,
      'drawCircle' => FALSE,
      'editMode' => TRUE,
      'dragMode' => TRUE,
      'cutPolygon' => FALSE,
      'removalMode' => TRUE,
    ],
    'reset_map' => self::getDefaultSettings()['reset_map'],
    'path' => self::getDefaultSettings()['path'],
    'geocoder' => self::getDefaultSettings()['geocoder'],
  ];
}