Improve handling of bounds calculation. Layers have to whitelist, vectors/markers can set themselves to ignore.

This commit is contained in:
David Molineus
2015-01-21 18:21:28 +01:00
parent 5d1ccb1d54
commit b3eb4c8e61
12 changed files with 130 additions and 93 deletions

View File

@@ -145,14 +145,15 @@ $GLOBALS['TL_DCA']['tl_leaflet_layer'] = array
),
'markers extends default' => array(
'+expert' => array('pointToLayer'),
'+active' => array('deferred')
'+active' => array('deferred', 'affectBounds')
),
'group extends default' => array(
'+title' => array('groupType'),
'+active' => array('affectBounds')
),
'vectors extends default' => array(
'+expert' => array('onEachFeature', 'pointToLayer'),
'+active' => array('deferred'),
'+active' => array('deferred', 'affectBounds'),
),
'reference extends default' => array(
'+title' => array('reference', 'standalone')
@@ -173,6 +174,9 @@ $GLOBALS['TL_DCA']['tl_leaflet_layer'] = array
'iconCreateFunction',
'disableDefaultStyle'
),
'+active' => array(
'affectBounds'
)
),
),
@@ -500,5 +504,14 @@ $GLOBALS['TL_DCA']['tl_leaflet_layer'] = array
'eval' => array('tl_class' => 'w50', 'submitOnChange' => false, 'isBoolean' => true),
'sql' => "char(1) NOT NULL default ''"
),
'affectBounds' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['affectBounds'],
'exclude' => true,
'inputType' => 'checkbox',
'default' => false,
'eval' => array('tl_class' => 'w50'),
'sql' => "char(1) NOT NULL default ''"
),
)
);

View File

@@ -116,7 +116,7 @@ $GLOBALS['TL_DCA']['tl_leaflet_marker'] = array
'riseOffset',
'customIcon',
),
'active' => array('active', 'affectBounds')
'active' => array('active', 'ignoreForBounds')
),
),
'metasubpalettes' => array(
@@ -286,9 +286,9 @@ $GLOBALS['TL_DCA']['tl_leaflet_marker'] = array
'eval' => array('maxlength' => 5, 'rgxp' => 'digit', 'tl_class' => 'clr w50', 'nullIfEmpty' => true),
'sql' => "int(5) NULL"
),
'affectBounds' => array
'ignoreForBounds' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_marker']['affectBounds'],
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_marker']['ignoreForBounds'],
'exclude' => true,
'inputType' => 'checkbox',
'default' => false,

View File

@@ -119,7 +119,7 @@ $GLOBALS['TL_DCA']['tl_leaflet_vector'] = array
'data' => array(),
'popup' => array(':hide','addPopup'),
'config' => array(':hide', 'style', 'className', 'clickable'),
'active' => array('active', 'affectBounds')
'active' => array('active', 'ignoreForBounds')
),
'polyline extends default' => array(
@@ -348,9 +348,9 @@ $GLOBALS['TL_DCA']['tl_leaflet_vector'] = array
),
'sql' => "mediumblob NULL"
),
'affectBounds' => array
'ignoreForBounds' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_vector']['affectBounds'],
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_vector']['ignoreForBounds'],
'exclude' => true,
'inputType' => 'checkbox',
'default' => false,