mirror of
https://github.com/netzmacht/contao-leaflet-maps.git
synced 2025-12-01 20:43:52 +01:00
Rework filter handling (Fixes #50).
This commit is contained in:
@@ -46,7 +46,6 @@ class NetzmachtContaoLeafletExtension extends Extension
|
||||
$loader->load('providers.yml');
|
||||
|
||||
// Other services
|
||||
$loader->load('filters.yml');
|
||||
$loader->load('mappers.yml');
|
||||
$loader->load('encoders.yml');
|
||||
$loader->load('layers.yml');
|
||||
|
||||
@@ -58,3 +58,8 @@ parameters:
|
||||
- 'id'
|
||||
- 'title'
|
||||
- 'alias'
|
||||
|
||||
# Filters can be passed to a data request to get only specific data from a layer.
|
||||
netzmacht.contao_leaflet.filters:
|
||||
bbox: Netzmacht\Contao\Leaflet\Filter\BboxFilter
|
||||
distance: Netzmacht\Contao\Leaflet\Filter\DistanceFilter
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
services:
|
||||
# Filters can be passed to a data request to get only specific data from a layer.
|
||||
netzmacht.contao_leaflet.filter.bbox:
|
||||
class: Netzmacht\Contao\Leaflet\Filter\BboxFilter
|
||||
tags:
|
||||
- { name: 'netzmacht.contao_leaflet.filter', alias: 'bbox' }
|
||||
|
||||
netzmacht.contao_leaflet.filter.distance:
|
||||
class: Netzmacht\Contao\Leaflet\Filter\DistanceFilter
|
||||
tags:
|
||||
- { name: 'netzmacht.contao_leaflet.filter', alias: 'distance' }
|
||||
@@ -14,7 +14,7 @@ services:
|
||||
- '@netzmacht.contao_toolkit.contao.input_adapter'
|
||||
- '@netzmacht.contao_leaflet.map.assets'
|
||||
- '@netzmacht.contao_leaflet.cache'
|
||||
- [] # TODO: Rework filter handling.
|
||||
- '@netzmacht.contao_leaflet.filter_factory'
|
||||
- '%kernel.debug%'
|
||||
|
||||
netzmacht.contao_leaflet.libraries:
|
||||
@@ -22,6 +22,11 @@ services:
|
||||
arguments:
|
||||
- '@contao.framework'
|
||||
|
||||
netzmacht.contao_leaflet.filter_factory:
|
||||
class: Netzmacht\Contao\Leaflet\Filter\FilterFactory
|
||||
arguments:
|
||||
- '%netzmacht.contao_leaflet.filters%'
|
||||
|
||||
netzmacht.contao_leaflet.cache:
|
||||
alias: 'netzmacht.contao_leaflet.cache.default'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user