Implement zoomSnap and zoomDelta.

This commit is contained in:
David Molineus
2016-10-11 10:25:28 +02:00
parent 1eba70b5b4
commit f22906b8b6
3 changed files with 36 additions and 2 deletions

View File

@@ -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'],

View File

@@ -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';

View File

@@ -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'));
}