Skip to content
Snippets Groups Projects
Commit 24e4c4da authored by Italo Mairo's avatar Italo Mairo
Browse files

Correct limitations of default Options (and Schema) of LeafletDefaultWidget...

Correct limitations of default Options (and Schema) of LeafletDefaultWidget ('Issue #3344455 by ekes')
parent 62ef263f
Branches
Tags 10.0.11
No related merge requests found
......@@ -115,9 +115,9 @@ field.widget.settings.leaflet_widget_default:
options:
type: text
label: 'Options'
locate:
fullscreen:
type: mapping
label: 'Locate User Position'
label: 'Leaflet Fullscreen'
mapping:
control:
type: boolean
......@@ -125,12 +125,12 @@ field.widget.settings.leaflet_widget_default:
options:
type: text
label: 'Options'
automatic:
type: boolean
label: 'Automatically locate user current position'
fullscreen:
path:
type: text
label: 'Path'
locate:
type: mapping
label: 'Leaflet Fullscreen'
label: 'Locate User Position'
mapping:
control:
type: boolean
......@@ -138,10 +138,9 @@ field.widget.settings.leaflet_widget_default:
options:
type: text
label: 'Options'
path:
type: text
label: 'Path'
automatic:
type: boolean
label: 'Automatically locate user current position'
geocoder:
type: mapping
label: 'Gecoder map control'
......
......@@ -169,7 +169,7 @@ class LeafletDefaultWidget extends GeofieldDefaultWidget {
public static function defaultSettings() {
$base_layers = self::getLeafletMaps();
$options = array_merge(parent::defaultSettings(), [
return array_merge(parent::defaultSettings(), [
'map' => [
'leaflet_map' => array_shift($base_layers),
'height' => 400,
......@@ -195,12 +195,37 @@ class LeafletDefaultWidget extends GeofieldDefaultWidget {
'removalMode' => TRUE,
'rotateMode' => FALSE,
],
'reset_map' => [
'control' => FALSE,
'options' => '{"position": "topleft", "title": "Reset View"}',
],
'fullscreen' => [
'control' => FALSE,
'options' => '{"position":"topleft","pseudoFullscreen":false}',
],
'path' => '{"color":"#3388ff","opacity":"1.0","stroke":true,"weight":3,"fill":"depends","fillColor":"*","fillOpacity":"0.2","radius":"6"}',
'feature_properties' => [
'values' => '',
],
'locate' => [
'control' => FALSE,
'options' => '{"position": "topright", "setView": "untilPanOrZoom", "returnToPrevBounds":true, "keepCurrentZoomLevel": true, "strings": {"title": "Locate my position"}}',
'automatic' => FALSE,
],
'geocoder' => [
'control' => FALSE,
'settings' => [
'position' => 'topright',
'input_size' => 20,
'providers' => [],
'min_terms' => 4,
'delay' => 800,
'zoom' => 16,
'popup' => FALSE,
'options' => '',
],
],
]);
$leaflet_map_default_settings = [];
foreach (self::getDefaultSettings() as $k => $setting) {
$leaflet_map_default_settings[$k] = $setting;
}
return $options + $leaflet_map_default_settings;
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment