diff --git a/module/assets/img/overpass.png b/module/assets/img/overpass.png new file mode 100644 index 0000000..2c41621 Binary files /dev/null and b/module/assets/img/overpass.png differ diff --git a/module/config/config.php b/module/config/config.php index 1ff685b..f0c9e4b 100644 --- a/module/config/config.php +++ b/module/config/config.php @@ -271,6 +271,10 @@ $GLOBALS['LEAFLET_LAYERS'] = array 'children' => false, 'icon' => 'system/modules/leaflet/assets/img/tile.png', ), + 'overpass' => array( + 'children' => false, + 'icon' => 'system/modules/leaflet/assets/img/overpass.png', + ), ); /* diff --git a/module/dca/tl_leaflet_layer.php b/module/dca/tl_leaflet_layer.php index cc42fd3..f856829 100644 --- a/module/dca/tl_leaflet_layer.php +++ b/module/dca/tl_leaflet_layer.php @@ -792,9 +792,9 @@ $GLOBALS['TL_DCA']['tl_leaflet_layer'] = array 'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['cacheLifeTime'], 'exclude' => true, 'inputType' => 'text', - 'default' => null, - 'eval' => array('maxlength' => 5, 'rgxp' => 'digit', 'tl_class' => 'w50', 'nullIfEmpty' => true), - 'sql' => "int(9) NOT NULL default '0'" + 'default' => 0, + 'eval' => array('maxlength' => 5, 'rgxp' => 'digit', 'tl_class' => 'w50'), + 'sql' => "int(10) unsigned NOT NULL default '0'" ), 'overpassQuery' => array ( @@ -815,7 +815,7 @@ $GLOBALS['TL_DCA']['tl_leaflet_layer'] = array 'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['overpassEndpoint'], 'exclude' => true, 'inputType' => 'text', - 'default' => null, + 'default' => '', 'eval' => array('tl_class' => 'long'), 'sql' => "varchar(255) NOT NULL default ''" ), @@ -850,7 +850,7 @@ $GLOBALS['TL_DCA']['tl_leaflet_layer'] = array 'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['minZoomIndicatorMessage'], 'exclude' => true, 'inputType' => 'text', - 'default' => null, + 'default' => '', 'eval' => array('tl_class' => 'long'), 'sql' => "varchar(255) NOT NULL default ''" ), @@ -859,7 +859,7 @@ $GLOBALS['TL_DCA']['tl_leaflet_layer'] = array 'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['minZoomIndicatorMessageNoLayer'], 'exclude' => true, 'inputType' => 'text', - 'default' => null, + 'default' => '', 'eval' => array('tl_class' => 'long'), 'sql' => "varchar(255) NOT NULL default ''" ), diff --git a/src/Netzmacht/Contao/Leaflet/Mapper/Layer/OverpassLayerMapper.php b/src/Netzmacht/Contao/Leaflet/Mapper/Layer/OverpassLayerMapper.php index ca6da15..1f9029d 100644 --- a/src/Netzmacht/Contao/Leaflet/Mapper/Layer/OverpassLayerMapper.php +++ b/src/Netzmacht/Contao/Leaflet/Mapper/Layer/OverpassLayerMapper.php @@ -31,6 +31,13 @@ class OverpassLayerMapper extends AbstractLayerMapper */ protected static $type = 'overpass'; + /** + * The definition class. + * + * @var string + */ + protected static $definitionClass = 'Netzmacht\LeafletPHP\Plugins\OverpassLayer\OverpassLayer'; + /** * {@inheritdoc} */ @@ -39,9 +46,9 @@ class OverpassLayerMapper extends AbstractLayerMapper parent::initialize(); $this->optionsBuilder - ->addOption('overpassQuery', 'query') - ->addConditionalOption('minZoom') - ->addConditionalOption('overpassEndpoint', 'endpoint'); + ->addOption('query', 'overpassQuery') + ->addOption('minzoom', 'minZoom') + ->addOption('overpassEndpoint', 'endpoint'); } /** @@ -61,9 +68,9 @@ class OverpassLayerMapper extends AbstractLayerMapper $minZoomIndicatorOptions = $definition->getMinZoomIndicatorOptions(); $minZoomIndicatorOptionsBuilder = new OptionsBuilder(); $minZoomIndicatorOptionsBuilder - ->addConditionalOption('minZoomIndicatorPosition', 'position') - ->addConditionalOption('minZoomIndicatorMessageNoLayer', 'minZoomMessageNoLayer') - ->addConditionalOption('minZoomIndicatorMessage', 'minZoomMessage'); + ->addOption('position', 'minZoomIndicatorPosition') + ->addOption('minZoomMessageNoLayer', 'minZoomIndicatorMessageNoLayer') + ->addOption('minZoomMessage', 'minZoomIndicatorMessage'); $minZoomIndicatorOptionsBuilder->build($minZoomIndicatorOptions, $model);