You are here

public static function Leaflet::getDefaultSettings in Geolocation Field 8.3

Same name and namespace in other branches
  1. 8.2 modules/geolocation_leaflet/src/Plugin/geolocation/MapProvider/Leaflet.php \Drupal\geolocation_leaflet\Plugin\geolocation\MapProvider\Leaflet::getDefaultSettings()

Provide a populated settings array.

Return value

array The settings array with the default map settings.

Overrides MapProviderBase::getDefaultSettings

2 calls to Leaflet::getDefaultSettings()
Leaflet::getSettingsForm in modules/geolocation_leaflet/src/Plugin/geolocation/MapProvider/Leaflet.php
Provide a generic map settings form array.
Leaflet::getSettingsSummary in modules/geolocation_leaflet/src/Plugin/geolocation/MapProvider/Leaflet.php
Provide a summary array to use in field formatters.

File

modules/geolocation_leaflet/src/Plugin/geolocation/MapProvider/Leaflet.php, line 22

Class

Leaflet
Provides Leaflet maps.

Namespace

Drupal\geolocation_leaflet\Plugin\geolocation\MapProvider

Code

public static function getDefaultSettings() {
  return array_replace_recursive(parent::getDefaultSettings(), [
    'zoom' => 10,
    'height' => '400px',
    'width' => '100%',
    'minZoom' => 0,
    'maxZoom' => 0,
    'maxBounds' => [
      'north_east_bound' => [],
      'south_west_bound' => [],
    ],
    'crs' => 'EPSG3857',
    'preferCanvas' => FALSE,
    'zoomSnap' => 1,
    'zoomDelta' => 1,
    'trackResize' => TRUE,
    'boxZoom' => TRUE,
    'doubleClickZoom' => TRUE,
    'dragging' => TRUE,
    'zoomAnimation' => TRUE,
    'zoomAnimationThreshold' => 4,
    'fadeAnimation' => TRUE,
    'markerZoomAnimation' => TRUE,
    'inertia' => FALSE,
    'inertiaDeceleration' => 3000,
    'easeLinearity' => 0.2,
    'worldCopyJump' => FALSE,
    'maxBoundsViscosity' => 0.0,
    'keyboard' => TRUE,
    'keyboardPanDelta' => 80,
    'scrollWheelZoom' => TRUE,
    'wheelDebounceTime' => 40,
    'wheelPxPerZoomLevel' => 60,
    'tap' => TRUE,
    'tapTolerance' => 15,
    'touchZoom' => TRUE,
    'bounceAtZoomLimits' => TRUE,
    'map_features' => [
      'leaflet_control_zoom' => [
        'enabled' => TRUE,
      ],
      'leaflet_control_attribution' => [
        'enabled' => TRUE,
        'settings' => [
          'position' => 'bottomright',
        ],
      ],
      'leaflet_marker_popup' => [
        'enabled' => TRUE,
      ],
    ],
  ]);
}