Implement boundsMode fit.

This commit is contained in:
David Molineus
2015-01-27 00:02:17 +01:00
parent 37b10c14fe
commit e2eceab60e
20 changed files with 388 additions and 72 deletions

View File

@@ -148,15 +148,15 @@ $GLOBALS['TL_DCA']['tl_leaflet_layer'] = array
),
'markers extends default' => array(
'+expert' => array('pointToLayer'),
'+active' => array('deferred', 'affectBounds')
'+config' => array('deferred', 'boundsMode')
),
'group extends default' => array(
'+title' => array('groupType'),
'+active' => array('affectBounds')
'+active' => array('boundsMode')
),
'vectors extends default' => array(
'+expert' => array('onEachFeature', 'pointToLayer'),
'+active' => array('deferred', 'affectBounds'),
'+config' => array('deferred', 'boundsMode'),
),
'reference extends default' => array(
'+title' => array('reference', 'standalone')
@@ -335,7 +335,7 @@ $GLOBALS['TL_DCA']['tl_leaflet_layer'] = array
'exclude' => true,
'inputType' => 'checkbox',
'default' => true,
'eval' => array('tl_class' => 'w50', 'submitOnChange' => false, 'isBoolean' => true),
'eval' => array('tl_class' => 'w50 m12', 'submitOnChange' => true, 'isBoolean' => true),
'sql' => "char(1) NOT NULL default '1'"
),
'groupType' => array
@@ -530,14 +530,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
'boundsMode' => 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 ''"
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['boundsMode'],
'exclude' => true,
'inputType' => 'select',
'options_callback' => array('Netzmacht\Contao\Leaflet\Dca\Layer', 'getBoundsModes'),
'eval' => array('tl_class' => 'w50', 'includeBlankOption' => true),
'sql' => "varchar(6) NOT NULL default ''"
),
'tileUrl' => array
(

View File

@@ -94,7 +94,7 @@ $GLOBALS['TL_DCA']['tl_leaflet_map'] = array
'metapalettes' => array(
'default' => array(
'title' => array('title', 'alias'),
'zoom' => array('center', 'zoom', 'adjustZoomExtra', 'adjustBounds'),
'zoom' => array('center', 'zoom', 'adjustZoomExtra', 'adjustBounds', 'dynamicLoad'),
'locate' => array('locate'),
'layers' => array('layers'),
'interaction' => array(
@@ -419,6 +419,15 @@ $GLOBALS['TL_DCA']['tl_leaflet_map'] = array
'eval' => array('tl_class' => 'clr w50', 'multiple' => true, 'helpwizard' => true),
'sql' => "varchar(255) NOT NULL default ''"
),
'dynamicLoad' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['dynamicLoad'],
'exclude' => true,
'inputType' => 'checkbox',
'default' => true,
'eval' => array('tl_class' => 'w50', 'submitOnChange' => false),
'sql' => "char(1) NOT NULL default ''"
),
'locate' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['locate'],

View File

@@ -176,18 +176,44 @@ $GLOBALS['TL_DCA']['tl_leaflet_marker'] = array
'exclude' => true,
'inputType' => 'text',
'save_callback' => array(
array('Netzmacht\Contao\Leaflet\Dca\Leaflet', 'validateCoordinate')
array('Netzmacht\Contao\Leaflet\Dca\Leaflet', 'validateCoordinate'),
array('Netzmacht\Contao\Leaflet\Dca\Marker', 'saveCoordinates')
),
'wizard' => array(
array('Netzmacht\Contao\Leaflet\Dca\Leaflet', 'getGeocoder')
),
'eval' => array(
'maxlength' => 255,
'tl_class' => 'long clr',
'nullIfEmpty' => true,
'maxlength' => 255,
'tl_class' => 'long clr',
'nullIfEmpty' => true,
'doNotSaveEmpty' => true,
),
'sql' => "varchar(255) NULL"
),
'latitude' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_marker']['latitude'],
'exclude' => true,
'inputType' => 'text',
'eval' => array('mandatory' => false, 'maxlength' => 255, 'tl_class' => 'w50'),
'sql' => "float NULL"
),
'longitude' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_marker']['longitude'],
'exclude' => true,
'inputType' => 'text',
'eval' => array('mandatory' => false, 'maxlength' => 255, 'tl_class' => 'w50'),
'sql' => "float NULL"
),
'altitude' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_marker']['altitude'],
'exclude' => true,
'inputType' => 'text',
'eval' => array('mandatory' => false, 'maxlength' => 255, 'tl_class' => 'w50'),
'sql' => "float NULL"
),
'active' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_marker']['active'],