mirror of
https://github.com/netzmacht/contao-leaflet-maps.git
synced 2025-11-28 11:04:08 +01:00
Implement zoomSnap and zoomDelta.
This commit is contained in:
@@ -128,7 +128,9 @@ $GLOBALS['TL_DCA']['tl_leaflet_map'] = array
|
||||
),
|
||||
'adjustZoomExtra' => array(
|
||||
'minZoom',
|
||||
'maxZoom'
|
||||
'maxZoom',
|
||||
'zoomSnap',
|
||||
'zoomDelta',
|
||||
),
|
||||
'locate' => array(
|
||||
':hide',
|
||||
@@ -289,6 +291,34 @@ $GLOBALS['TL_DCA']['tl_leaflet_map'] = array
|
||||
),
|
||||
'sql' => "int(4) NULL"
|
||||
),
|
||||
'zoomSnap' => array
|
||||
(
|
||||
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['zoomSnap'],
|
||||
'exclude' => true,
|
||||
'inputType' => 'text',
|
||||
'eval' => array(
|
||||
'maxlength' => 4,
|
||||
'rgxp' => 'digit',
|
||||
'tl_class' => 'w50',
|
||||
'includeBlankOption' => true,
|
||||
'nullIfEmpty' => true
|
||||
),
|
||||
'sql' => "varchar(4) NULL"
|
||||
),
|
||||
'zoomDelta' => array
|
||||
(
|
||||
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['zoomDelta'],
|
||||
'exclude' => true,
|
||||
'inputType' => 'text',
|
||||
'eval' => array(
|
||||
'maxlength' => 4,
|
||||
'rgxp' => 'digit',
|
||||
'tl_class' => 'w50',
|
||||
'includeBlankOption' => true,
|
||||
'nullIfEmpty' => true
|
||||
),
|
||||
'sql' => "varchar(4) NULL"
|
||||
),
|
||||
'dragging' => array
|
||||
(
|
||||
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['dragging'],
|
||||
|
||||
@@ -55,6 +55,10 @@ $GLOBALS['TL_LANG']['tl_leaflet_map']['minZoom'][0] = 'Minimum zoom
|
||||
$GLOBALS['TL_LANG']['tl_leaflet_map']['minZoom'][1] = 'Minimum zoom level of the map. Overrides any minZoom set on map layers.';
|
||||
$GLOBALS['TL_LANG']['tl_leaflet_map']['maxZoom'][0] = 'Maximum zoom level';
|
||||
$GLOBALS['TL_LANG']['tl_leaflet_map']['maxZoom'][1] = 'Maximum zoom level of the map. This overrides any maxZoom set on map layers.';
|
||||
$GLOBALS['TL_LANG']['tl_leaflet_map']['zoomSnap'][0] = 'Zoom snap';
|
||||
$GLOBALS['TL_LANG']['tl_leaflet_map']['zoomSnap'][1] = 'Forces the map\'s zoom level to always be a multiple of the number. Default is 1.';
|
||||
$GLOBALS['TL_LANG']['tl_leaflet_map']['zoomDelta'][0] = 'Zoom delta';
|
||||
$GLOBALS['TL_LANG']['tl_leaflet_map']['zoomDelta'][1] = 'Controls how much the map\'s zoom level will change after zoom in or zoom out.';
|
||||
$GLOBALS['TL_LANG']['tl_leaflet_map']['zoomControl'][0] = 'Add default zoom control';
|
||||
$GLOBALS['TL_LANG']['tl_leaflet_map']['zoomControl'][1] = 'Whether the zoom control is added to the map by default.';
|
||||
$GLOBALS['TL_LANG']['tl_leaflet_map']['bounceAtZoomLimits'][0] = 'Bounce at zoom limits';
|
||||
|
||||
@@ -50,7 +50,7 @@ class MapMapper extends AbstractMapper
|
||||
->addOptions('center', 'zoom', 'zoomControl')
|
||||
->addOptions('dragging', 'touchZoom', 'scrollWheelZoom', 'doubleClickZoom', 'boxZoom', 'tap', 'keyboard')
|
||||
->addOptions('trackResize', 'closeOnClick', 'bounceAtZoomLimits')
|
||||
->addConditionalOptions('adjustZoomExtra', array('minZoom', 'maxZoom'))
|
||||
->addConditionalOptions('adjustZoomExtra', array('minZoom', 'maxZoom', 'zoomSnap', 'zoomDelta'))
|
||||
->addConditionalOptions('keyboard', array('keyboardPanOffset', 'keyboardZoomOffset'));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user