diff --git a/src/Netzmacht/Contao/Leaflet/Mapper/AbstractMapper.php b/src/Netzmacht/Contao/Leaflet/Mapper/AbstractMapper.php index fd4db71..22f2319 100644 --- a/src/Netzmacht/Contao/Leaflet/Mapper/AbstractMapper.php +++ b/src/Netzmacht/Contao/Leaflet/Mapper/AbstractMapper.php @@ -11,8 +11,8 @@ namespace Netzmacht\Contao\Leaflet\Mapper; +use Netzmacht\Contao\Leaflet\Filter\Filter; use Netzmacht\LeafletPHP\Definition; -use Netzmacht\LeafletPHP\Definition\Type\LatLngBounds; /** * Class AbstractMapper is made for mapping Contao models to the definition. @@ -62,14 +62,14 @@ abstract class AbstractMapper implements Mapper public function handle( $model, DefinitionMapper $mapper, - LatLngBounds $bounds = null, + Filter $filter = null, $elementId = null, Definition $parent = null ) { - $definition = $this->createInstance($model, $mapper, $bounds, $elementId); + $definition = $this->createInstance($model, $mapper, $filter, $elementId); $this->optionsBuilder->build($definition, $model); - $this->build($definition, $model, $mapper, $bounds, $parent); + $this->build($definition, $model, $mapper, $filter, $parent); return $definition; } @@ -77,7 +77,7 @@ abstract class AbstractMapper implements Mapper /** * {@inheritdoc} */ - public function match($model, LatLngBounds $bounds = null) + public function match($model, Filter $filter = null) { $modelClass = static::$modelClass; @@ -99,7 +99,7 @@ abstract class AbstractMapper implements Mapper * @param Definition $definition The definition being built. * @param \Model $model The model. * @param DefinitionMapper $mapper The definition mapper. - * @param LatLngBounds $bounds Optional bounds where elements should be in. + * @param Filter|null $filter Optional request filter. * @param Definition|null $parent The parent object. * * @return void @@ -110,7 +110,7 @@ abstract class AbstractMapper implements Mapper Definition $definition, \Model $model, DefinitionMapper $mapper, - LatLngBounds $bounds = null, + Filter $filter = null, Definition $parent = null ) { } @@ -120,7 +120,7 @@ abstract class AbstractMapper implements Mapper * * @param \Model $model The model. * @param DefinitionMapper $mapper The definition mapper. - * @param LatLngBounds $bounds Optional bounds where elements should be in. + * @param Filter $filter Optional request filter. * @param string|null $elementId Optional element id. * * @return Definition @@ -128,11 +128,11 @@ abstract class AbstractMapper implements Mapper protected function createInstance( \Model $model, DefinitionMapper $mapper, - LatLngBounds $bounds = null, + Filter $filter = null, $elementId = null ) { - $reflector = new \ReflectionClass($this->getClassName($model, $mapper, $bounds)); - $instance = $reflector->newInstanceArgs($this->buildConstructArguments($model, $mapper, $bounds, $elementId)); + $reflector = new \ReflectionClass($this->getClassName($model, $mapper, $filter)); + $instance = $reflector->newInstanceArgs($this->buildConstructArguments($model, $mapper, $filter, $elementId)); return $instance; } @@ -142,7 +142,7 @@ abstract class AbstractMapper implements Mapper * * @param \Model $model The model. * @param DefinitionMapper $mapper The definition mapper. - * @param LatLngBounds $bounds Optional bounds where elements should be in. + * @param Filter $filter Optional request filter. * @param string|null $elementId Optional element id. * * @return array @@ -152,7 +152,7 @@ abstract class AbstractMapper implements Mapper protected function buildConstructArguments( \Model $model, DefinitionMapper $mapper, - LatLngBounds $bounds = null, + Filter $filter = null, $elementId = null ) { return array( @@ -165,13 +165,13 @@ abstract class AbstractMapper implements Mapper * * @param \Model $model The model. * @param DefinitionMapper $mapper The definition mapper. - * @param LatLngBounds $bounds Optional bounds where elements should be in. + * @param Filter $filter Optional request filter. * * @return string * * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ - protected function getClassName(\Model $model, DefinitionMapper $mapper, LatLngBounds $bounds = null) + protected function getClassName(\Model $model, DefinitionMapper $mapper, Filter $filter = null) { return static::$definitionClass; } diff --git a/src/Netzmacht/Contao/Leaflet/Mapper/AbstractTypeMapper.php b/src/Netzmacht/Contao/Leaflet/Mapper/AbstractTypeMapper.php index 30bca89..b557e12 100644 --- a/src/Netzmacht/Contao/Leaflet/Mapper/AbstractTypeMapper.php +++ b/src/Netzmacht/Contao/Leaflet/Mapper/AbstractTypeMapper.php @@ -11,7 +11,7 @@ namespace Netzmacht\Contao\Leaflet\Mapper; -use Netzmacht\LeafletPHP\Definition\Type\LatLngBounds; +use Netzmacht\Contao\Leaflet\Filter\Filter; /** * Class AbstractTypeMapper is the base mapper for tables containing different types of definitins. @@ -30,7 +30,7 @@ abstract class AbstractTypeMapper extends AbstractMapper /** * {@inheritdoc} */ - public function match($model, LatLngBounds $bounds = null) + public function match($model, Filter $filter = null) { return parent::match($model) && $model->type === static::$type; } diff --git a/src/Netzmacht/Contao/Leaflet/Mapper/Control/AttributionControlMapper.php b/src/Netzmacht/Contao/Leaflet/Mapper/Control/AttributionControlMapper.php index 7e7712d..e4dacf2 100644 --- a/src/Netzmacht/Contao/Leaflet/Mapper/Control/AttributionControlMapper.php +++ b/src/Netzmacht/Contao/Leaflet/Mapper/Control/AttributionControlMapper.php @@ -11,11 +11,11 @@ namespace Netzmacht\Contao\Leaflet\Mapper\Control; +use Netzmacht\Contao\Leaflet\Filter\Filter; use Netzmacht\Contao\Leaflet\Mapper\DefinitionMapper; use Netzmacht\LeafletPHP\Definition; use Netzmacht\LeafletPHP\Definition\Control\Attribution; use Netzmacht\LeafletPHP\Definition\Map; -use Netzmacht\LeafletPHP\Definition\Type\LatLngBounds; /** * AttributionControlMapper maps the the attribution database definition to the definition class. @@ -55,7 +55,7 @@ class AttributionControlMapper extends AbstractControlMapper Definition $definition, \Model $model, DefinitionMapper $mapper, - LatLngBounds $bounds = null, + Filter $filter = null, Definition $parent = null ) { if (!$definition instanceof Attribution) { diff --git a/src/Netzmacht/Contao/Leaflet/Mapper/Control/LayersControlMapper.php b/src/Netzmacht/Contao/Leaflet/Mapper/Control/LayersControlMapper.php index 37d1254..8457f74 100644 --- a/src/Netzmacht/Contao/Leaflet/Mapper/Control/LayersControlMapper.php +++ b/src/Netzmacht/Contao/Leaflet/Mapper/Control/LayersControlMapper.php @@ -11,10 +11,9 @@ namespace Netzmacht\Contao\Leaflet\Mapper\Control; +use Netzmacht\Contao\Leaflet\Filter\Filter; use Netzmacht\Contao\Leaflet\Mapper\DefinitionMapper; use Netzmacht\Contao\Leaflet\Model\ControlModel; -use Netzmacht\Contao\Leaflet\Model\LayerModel; -use Netzmacht\LeafletPHP\Definition\Type\LatLngBounds; /** * Class LayersControlMapper maps the control model to the layers control definition. @@ -43,10 +42,10 @@ class LayersControlMapper extends AbstractControlMapper protected function buildConstructArguments( \Model $model, DefinitionMapper $mapper, - LatLngBounds $bounds = null, + Filter $filter = null, $elementId = null ) { - $arguments = parent::buildConstructArguments($model, $mapper, $bounds, $elementId); + $arguments = parent::buildConstructArguments($model, $mapper, $filter, $elementId); $arguments[1] = array(); $arguments[2] = array(); @@ -57,7 +56,7 @@ class LayersControlMapper extends AbstractControlMapper foreach ($collection as $layer) { $argument = ($layer->controlMode === 'overlay') ? 2 : 1; - $arguments[$argument][] = $mapper->handle($layer, $bounds); + $arguments[$argument][] = $mapper->handle($layer, $filter); } } diff --git a/src/Netzmacht/Contao/Leaflet/Mapper/Control/LoadingControlMapper.php b/src/Netzmacht/Contao/Leaflet/Mapper/Control/LoadingControlMapper.php index aa4f6fb..272c76b 100644 --- a/src/Netzmacht/Contao/Leaflet/Mapper/Control/LoadingControlMapper.php +++ b/src/Netzmacht/Contao/Leaflet/Mapper/Control/LoadingControlMapper.php @@ -11,11 +11,11 @@ namespace Netzmacht\Contao\Leaflet\Mapper\Control; +use Netzmacht\Contao\Leaflet\Filter\Filter; use Netzmacht\Contao\Leaflet\Mapper\DefinitionMapper; use Netzmacht\Contao\Leaflet\Model\ControlModel; use Netzmacht\LeafletPHP\Definition; use Netzmacht\LeafletPHP\Definition\Control\Zoom; -use Netzmacht\LeafletPHP\Definition\Type\LatLngBounds; use Netzmacht\LeafletPHP\Plugins\Loading\LoadingControl; use Netzmacht\LeafletPHP\Plugins\Loading\SpinJsLoadingControl; @@ -36,7 +36,7 @@ class LoadingControlMapper extends AbstractControlMapper /** * {@inheritdoc} */ - protected function getClassName(\Model $model, DefinitionMapper $mapper, LatLngBounds $bounds = null) + protected function getClassName(\Model $model, DefinitionMapper $mapper, Filter $filter = null) { if ($model->spinjs) { return 'Netzmacht\LeafletPHP\Plugins\Loading\SpinJsLoadingControl'; @@ -62,10 +62,10 @@ class LoadingControlMapper extends AbstractControlMapper Definition $definition, \Model $model, DefinitionMapper $mapper, - LatLngBounds $bounds = null, + Filter $filter = null, Definition $parent = null ) { - parent::build($definition, $model, $mapper, $bounds); + parent::build($definition, $model, $mapper, $filter); if ($definition instanceof SpinJsLoadingControl && $model->spin) { $config = json_decode($model->spin, true); diff --git a/src/Netzmacht/Contao/Leaflet/Mapper/DefinitionMapper.php b/src/Netzmacht/Contao/Leaflet/Mapper/DefinitionMapper.php index 0dc0836..2d32d37 100644 --- a/src/Netzmacht/Contao/Leaflet/Mapper/DefinitionMapper.php +++ b/src/Netzmacht/Contao/Leaflet/Mapper/DefinitionMapper.php @@ -14,6 +14,7 @@ namespace Netzmacht\Contao\Leaflet\Mapper; use Netzmacht\Contao\Leaflet\Event\BuildDefinitionEvent; use Netzmacht\Contao\Leaflet\Event\ConvertToGeoJsonEvent; use Netzmacht\Contao\Leaflet\Event\GetHashEvent; +use Netzmacht\Contao\Leaflet\Filter\Filter; use Netzmacht\LeafletPHP\Definition; use Netzmacht\LeafletPHP\Definition\GeoJson\ConvertsToGeoJsonFeature; use Netzmacht\LeafletPHP\Definition\GeoJson\Feature; @@ -81,7 +82,7 @@ class DefinitionMapper * Build a model. * * @param mixed $model The definition model. - * @param LatLngBounds $bounds Optional bounds where elements should be in. + * @param Filter $filter Optional request filter. * @param string $elementId Optional element id. If none given the mapId or alias is used. * @param Definition|null $parent Optional pass the parent object. * @@ -89,16 +90,16 @@ class DefinitionMapper * * @throws \RuntimeException If model could not be mapped to a definition. */ - public function handle($model, LatLngBounds $bounds = null, $elementId = null, $parent = null) + public function handle($model, Filter $filter = null, $elementId = null, $parent = null) { $hash = $this->hash($model, $elementId); if (!isset($this->mapped[$hash])) { $mapper = $this->getMapper($model); - $definition = $mapper->handle($model, $this, $bounds, $elementId, $parent); + $definition = $mapper->handle($model, $this, $filter, $elementId, $parent); if ($definition) { - $event = new BuildDefinitionEvent($definition, $model, $bounds); + $event = new BuildDefinitionEvent($definition, $model, $filter); $this->eventDispatcher->dispatch($event::NAME, $event); } @@ -111,19 +112,19 @@ class DefinitionMapper /** * Build a model. * - * @param mixed $model The definition model. - * @param LatLngBounds $bounds Optional bounds where elements should be in. + * @param mixed $model The definition model. + * @param Filter $filter Optional request filter. * * @return FeatureCollection|Feature|null * * @throws \RuntimeException If a model could not be mapped to the GeoJSON representation. */ - public function handleGeoJson($model, LatLngBounds $bounds = null) + public function handleGeoJson($model, Filter $filter = null) { $mapper = $this->getMapper($model); if ($mapper instanceof GeoJsonMapper) { - return $mapper->handleGeoJson($model, $this, $bounds); + return $mapper->handleGeoJson($model, $this, $filter); } throw new \RuntimeException( diff --git a/src/Netzmacht/Contao/Leaflet/Mapper/GeoJsonMapper.php b/src/Netzmacht/Contao/Leaflet/Mapper/GeoJsonMapper.php index 395007e..b0c477c 100644 --- a/src/Netzmacht/Contao/Leaflet/Mapper/GeoJsonMapper.php +++ b/src/Netzmacht/Contao/Leaflet/Mapper/GeoJsonMapper.php @@ -11,8 +11,8 @@ namespace Netzmacht\Contao\Leaflet\Mapper; +use Netzmacht\Contao\Leaflet\Filter\Filter; use Netzmacht\LeafletPHP\Definition\GeoJson\GeoJsonFeature; -use Netzmacht\LeafletPHP\Definition\Type\LatLngBounds; /** * Interface GeoJsonMapper describes mappers which can convert their definition to a GeoJSON representation. @@ -26,9 +26,9 @@ interface GeoJsonMapper * * @param \Model $model The model being mapped. * @param DefinitionMapper $mapper The definition mapper. - * @param LatLngBounds $bounds The requested bounds. + * @param Filter $filter Optional request filter. * * @return GeoJsonFeature|null */ - public function handleGeoJson(\Model $model, DefinitionMapper $mapper, LatLngBounds $bounds = null); + public function handleGeoJson(\Model $model, DefinitionMapper $mapper, Filter $filter = null); } diff --git a/src/Netzmacht/Contao/Leaflet/Mapper/Layer/GroupLayerMapper.php b/src/Netzmacht/Contao/Leaflet/Mapper/Layer/GroupLayerMapper.php index ad6690f..7ebcbe1 100644 --- a/src/Netzmacht/Contao/Leaflet/Mapper/Layer/GroupLayerMapper.php +++ b/src/Netzmacht/Contao/Leaflet/Mapper/Layer/GroupLayerMapper.php @@ -11,12 +11,12 @@ namespace Netzmacht\Contao\Leaflet\Mapper\Layer; +use Netzmacht\Contao\Leaflet\Filter\Filter; use Netzmacht\Contao\Leaflet\Mapper\DefinitionMapper; use Netzmacht\Contao\Leaflet\Model\LayerModel; use Netzmacht\LeafletPHP\Definition; use Netzmacht\LeafletPHP\Definition\Group\LayerGroup; use Netzmacht\LeafletPHP\Definition\Layer; -use Netzmacht\LeafletPHP\Definition\Type\LatLngBounds; /** * Class GroupLayerMapper maps the layer model to the group layer definition. @@ -35,7 +35,7 @@ class GroupLayerMapper extends AbstractLayerMapper /** * {@inheritdoc} */ - protected function getClassName(\Model $model, DefinitionMapper $mapper, LatLngBounds $bounds = null) + protected function getClassName(\Model $model, DefinitionMapper $mapper, Filter $filter = null) { if ($model->groupType === 'feature') { return 'Netzmacht\LeafletPHP\Definition\Group\FeatureGroup'; @@ -51,7 +51,7 @@ class GroupLayerMapper extends AbstractLayerMapper Definition $definition, \Model $model, DefinitionMapper $mapper, - LatLngBounds $bounds = null, + Filter $filter = null, Definition $parent = null ) { if (!$definition instanceof LayerGroup) { diff --git a/src/Netzmacht/Contao/Leaflet/Mapper/Layer/MarkerClusterLayerMapper.php b/src/Netzmacht/Contao/Leaflet/Mapper/Layer/MarkerClusterLayerMapper.php index e67c1f8..2024c81 100644 --- a/src/Netzmacht/Contao/Leaflet/Mapper/Layer/MarkerClusterLayerMapper.php +++ b/src/Netzmacht/Contao/Leaflet/Mapper/Layer/MarkerClusterLayerMapper.php @@ -11,13 +11,13 @@ namespace Netzmacht\Contao\Leaflet\Mapper\Layer; +use Netzmacht\Contao\Leaflet\Filter\Filter; use Netzmacht\Contao\Leaflet\Mapper\DefinitionMapper; use Netzmacht\Contao\Leaflet\Model\LayerModel; use Netzmacht\JavascriptBuilder\Type\AnonymousFunction; use Netzmacht\JavascriptBuilder\Type\Expression; use Netzmacht\LeafletPHP\Definition; use Netzmacht\LeafletPHP\Definition\Layer; -use Netzmacht\LeafletPHP\Definition\Type\LatLngBounds; use Netzmacht\LeafletPHP\Plugins\MarkerCluster\MarkerClusterGroup; use Netzmacht\LeafletPHP\Plugins\Omnivore\OmnivoreLayer; @@ -67,10 +67,10 @@ class MarkerClusterLayerMapper extends AbstractLayerMapper Definition $definition, \Model $model, DefinitionMapper $mapper, - LatLngBounds $bounds = null, + Filter $filter = null, Definition $parent = null ) { - parent::build($definition, $model, $mapper, $bounds, $parent); + parent::build($definition, $model, $mapper, $filter, $parent); /** @var MarkerClusterGroup $definition */ diff --git a/src/Netzmacht/Contao/Leaflet/Mapper/Layer/MarkersLayerMapper.php b/src/Netzmacht/Contao/Leaflet/Mapper/Layer/MarkersLayerMapper.php index 796e797..967d5bf 100644 --- a/src/Netzmacht/Contao/Leaflet/Mapper/Layer/MarkersLayerMapper.php +++ b/src/Netzmacht/Contao/Leaflet/Mapper/Layer/MarkersLayerMapper.php @@ -11,6 +11,7 @@ namespace Netzmacht\Contao\Leaflet\Mapper\Layer; +use Netzmacht\Contao\Leaflet\Filter\Filter; use Netzmacht\Contao\Leaflet\Mapper\DefinitionMapper; use Netzmacht\Contao\Leaflet\Mapper\GeoJsonMapper; use Netzmacht\Contao\Leaflet\Model\MarkerModel; @@ -19,8 +20,6 @@ use Netzmacht\JavascriptBuilder\Type\Expression; use Netzmacht\LeafletPHP\Definition; use Netzmacht\LeafletPHP\Definition\GeoJson\FeatureCollection; use Netzmacht\LeafletPHP\Definition\Group\GeoJson; -use Netzmacht\LeafletPHP\Definition\Type\LatLngBounds; -use Netzmacht\LeafletPHP\Definition\UI\Marker; /** * Class MarkersLayerMapper maps the layer model to the markers definition. @@ -39,7 +38,7 @@ class MarkersLayerMapper extends AbstractLayerMapper implements GeoJsonMapper /** * {@inheritdoc} */ - protected function getClassName(\Model $model, DefinitionMapper $mapper, LatLngBounds $bounds = null) + protected function getClassName(\Model $model, DefinitionMapper $mapper, Filter $filter = null) { if ($model->deferred) { return 'Netzmacht\LeafletPHP\Plugins\Omnivore\GeoJson'; @@ -54,7 +53,7 @@ class MarkersLayerMapper extends AbstractLayerMapper implements GeoJsonMapper protected function buildConstructArguments( \Model $model, DefinitionMapper $mapper, - LatLngBounds $bounds = null, + Filter $filter = null, $elementId = null ) { if ($model->deferred) { @@ -75,7 +74,7 @@ class MarkersLayerMapper extends AbstractLayerMapper implements GeoJsonMapper return array($this->getElementId($model, $elementId), RequestUrl::create($model->id)); } - return parent::buildConstructArguments($model, $mapper, $bounds, $elementId); + return parent::buildConstructArguments($model, $mapper, $filter, $elementId); } /** @@ -85,7 +84,7 @@ class MarkersLayerMapper extends AbstractLayerMapper implements GeoJsonMapper Definition $definition, \Model $model, DefinitionMapper $mapper, - LatLngBounds $bounds = null, + Filter $filter = null, Definition $parent = null ) { if ($definition instanceof GeoJson) { @@ -115,7 +114,7 @@ class MarkersLayerMapper extends AbstractLayerMapper implements GeoJsonMapper /** * {@inheritdoc} */ - public function handleGeoJson(\Model $model, DefinitionMapper $mapper, LatLngBounds $bounds = null) + public function handleGeoJson(\Model $model, DefinitionMapper $mapper, Filter $filter = null) { $feature = new FeatureCollection(); $collection = $this->loadMarkerModels($model); diff --git a/src/Netzmacht/Contao/Leaflet/Mapper/Layer/ProviderLayerMapper.php b/src/Netzmacht/Contao/Leaflet/Mapper/Layer/ProviderLayerMapper.php index 9ef38f5..ee45ed2 100644 --- a/src/Netzmacht/Contao/Leaflet/Mapper/Layer/ProviderLayerMapper.php +++ b/src/Netzmacht/Contao/Leaflet/Mapper/Layer/ProviderLayerMapper.php @@ -11,10 +11,10 @@ namespace Netzmacht\Contao\Leaflet\Mapper\Layer; +use Netzmacht\Contao\Leaflet\Filter\Filter; use Netzmacht\Contao\Leaflet\Mapper\DefinitionMapper; use Netzmacht\Contao\Leaflet\Mapper\OptionsBuilder; use Netzmacht\LeafletPHP\Definition; -use Netzmacht\LeafletPHP\Definition\Type\LatLngBounds; /** * Class ProviderLayerMapper maps the layer model to the tile provider definition. @@ -52,7 +52,7 @@ class ProviderLayerMapper extends AbstractLayerMapper /** * {@inheritdoc} */ - protected function getClassName(\Model $model, DefinitionMapper $mapper, LatLngBounds $bounds = null) + protected function getClassName(\Model $model, DefinitionMapper $mapper, Filter $filter = null) { if (isset($this->providers[$model->tile_provider]['class'])) { return $this->providers[$model->tile_provider]['class']; @@ -68,7 +68,7 @@ class ProviderLayerMapper extends AbstractLayerMapper Definition $definition, \Model $model, DefinitionMapper $mapper, - LatLngBounds $bounds = null, + Filter $filter = null, Definition $parent = null ) { if (!empty($this->providers[$model->tile_provider]['options'])) { @@ -86,7 +86,7 @@ class ProviderLayerMapper extends AbstractLayerMapper protected function buildConstructArguments( \Model $model, DefinitionMapper $mapper, - LatLngBounds $bounds = null, + Filter $filter = null, $elementId = null ) { return array( diff --git a/src/Netzmacht/Contao/Leaflet/Mapper/Layer/ReferenceLayerMapper.php b/src/Netzmacht/Contao/Leaflet/Mapper/Layer/ReferenceLayerMapper.php index 825a7db..27270af 100644 --- a/src/Netzmacht/Contao/Leaflet/Mapper/Layer/ReferenceLayerMapper.php +++ b/src/Netzmacht/Contao/Leaflet/Mapper/Layer/ReferenceLayerMapper.php @@ -11,10 +11,10 @@ namespace Netzmacht\Contao\Leaflet\Mapper\Layer; +use Netzmacht\Contao\Leaflet\Filter\Filter; use Netzmacht\Contao\Leaflet\Mapper\DefinitionMapper; use Netzmacht\Contao\Leaflet\Model\LayerModel; use Netzmacht\LeafletPHP\Definition; -use Netzmacht\LeafletPHP\Definition\Type\LatLngBounds; /** * Class ReferenceLayerMapper maps an reference layer to another layer. @@ -36,7 +36,7 @@ class ReferenceLayerMapper extends AbstractLayerMapper public function handle( $model, DefinitionMapper $mapper, - LatLngBounds $bounds = null, + Filter $filter = null, $elementId = null, Definition $parent = null ) { @@ -48,6 +48,6 @@ class ReferenceLayerMapper extends AbstractLayerMapper $elementId = $model->standalone ? $this->getElementId($model, $elementId) : null; - return $mapper->handle($reference, $bounds, $elementId); + return $mapper->handle($reference, $filter, $elementId); } } diff --git a/src/Netzmacht/Contao/Leaflet/Mapper/Layer/TileLayerMapper.php b/src/Netzmacht/Contao/Leaflet/Mapper/Layer/TileLayerMapper.php index 827f84e..ef23c6a 100644 --- a/src/Netzmacht/Contao/Leaflet/Mapper/Layer/TileLayerMapper.php +++ b/src/Netzmacht/Contao/Leaflet/Mapper/Layer/TileLayerMapper.php @@ -11,6 +11,7 @@ namespace Netzmacht\Contao\Leaflet\Mapper\Layer; +use Netzmacht\Contao\Leaflet\Filter\Filter; use Netzmacht\Contao\Leaflet\Mapper\DefinitionMapper; use Netzmacht\LeafletPHP\Definition; use Netzmacht\LeafletPHP\Definition\Raster\TileLayer; @@ -64,10 +65,10 @@ class TileLayerMapper extends AbstractLayerMapper protected function buildConstructArguments( \Model $model, DefinitionMapper $mapper, - LatLngBounds $bounds = null, + Filter $filter = null, $elementId = null ) { - $arguments = parent::buildConstructArguments($model, $mapper, $bounds, $elementId); + $arguments = parent::buildConstructArguments($model, $mapper, $filter, $elementId); $arguments[] = $model->tileUrl; @@ -81,24 +82,24 @@ class TileLayerMapper extends AbstractLayerMapper Definition $definition, \Model $model, DefinitionMapper $mapper, - LatLngBounds $bounds = null, + Filter $filter = null, Definition $parent = null ) { - parent::build($definition, $model, $mapper, $bounds, $parent); + parent::build($definition, $model, $mapper, $filter, $parent); /** @var TileLayer $definition */ - $bounds = deserialize($model->bounds); + $filter = deserialize($model->bounds); - if ($bounds[0] && $bounds[1]) { - $bounds = array_map( + if ($filter[0] && $filter[1]) { + $filter = array_map( function ($value) { return explode(',', $value, 3); }, - $bounds + $filter ); - $bounds = LatLngBounds::fromArray($bounds); - $definition->setBounds($bounds); + $filter = LatLngBounds::fromArray($filter); + $definition->setBounds($filter); } } } diff --git a/src/Netzmacht/Contao/Leaflet/Mapper/Layer/VectorsLayerMapper.php b/src/Netzmacht/Contao/Leaflet/Mapper/Layer/VectorsLayerMapper.php index 964db57..94bf3fc 100644 --- a/src/Netzmacht/Contao/Leaflet/Mapper/Layer/VectorsLayerMapper.php +++ b/src/Netzmacht/Contao/Leaflet/Mapper/Layer/VectorsLayerMapper.php @@ -11,18 +11,15 @@ namespace Netzmacht\Contao\Leaflet\Mapper\Layer; +use Netzmacht\Contao\Leaflet\Filter\Filter; use Netzmacht\Contao\Leaflet\Mapper\DefinitionMapper; use Netzmacht\Contao\Leaflet\Mapper\GeoJsonMapper; use Netzmacht\Contao\Leaflet\Model\VectorModel; use Netzmacht\Contao\Leaflet\Frontend\RequestUrl; use Netzmacht\JavascriptBuilder\Type\Expression; use Netzmacht\LeafletPHP\Definition; -use Netzmacht\LeafletPHP\Definition\GeoJson\ConvertsToGeoJsonFeature; -use Netzmacht\LeafletPHP\Definition\GeoJson\Feature; use Netzmacht\LeafletPHP\Definition\GeoJson\FeatureCollection; -use Netzmacht\LeafletPHP\Definition\GeoJson\GeoJsonFeature; use Netzmacht\LeafletPHP\Definition\Group\GeoJson; -use Netzmacht\LeafletPHP\Definition\Type\LatLngBounds; use Netzmacht\LeafletPHP\Definition\Vector; /** @@ -42,7 +39,7 @@ class VectorsLayerMapper extends AbstractLayerMapper implements GeoJsonMapper /** * {@inheritdoc} */ - protected function getClassName(\Model $model, DefinitionMapper $mapper, LatLngBounds $bounds = null) + protected function getClassName(\Model $model, DefinitionMapper $mapper, Filter $filter = null) { if ($model->deferred) { return 'Netzmacht\LeafletPHP\Plugins\Omnivore\GeoJson'; @@ -57,7 +54,7 @@ class VectorsLayerMapper extends AbstractLayerMapper implements GeoJsonMapper protected function buildConstructArguments( \Model $model, DefinitionMapper $mapper, - LatLngBounds $bounds = null, + Filter $filter = null, $elementId = null ) { if ($model->deferred) { @@ -85,7 +82,7 @@ class VectorsLayerMapper extends AbstractLayerMapper implements GeoJsonMapper return array($this->getElementId($model, $elementId), RequestUrl::create($model->id)); } - return parent::buildConstructArguments($model, $mapper, $bounds, $elementId); + return parent::buildConstructArguments($model, $mapper, $filter, $elementId); } /** @@ -95,7 +92,7 @@ class VectorsLayerMapper extends AbstractLayerMapper implements GeoJsonMapper Definition $definition, \Model $model, DefinitionMapper $mapper, - LatLngBounds $bounds = null, + Filter $filter = null, Definition $parent = null ) { if ($definition instanceof GeoJson) { @@ -123,7 +120,7 @@ class VectorsLayerMapper extends AbstractLayerMapper implements GeoJsonMapper /** * {@inheritdoc} */ - public function handleGeoJson(\Model $model, DefinitionMapper $mapper, LatLngBounds $bounds = null) + public function handleGeoJson(\Model $model, DefinitionMapper $mapper, Filter $filter = null) { $definition = new FeatureCollection(); $collection = $this->loadVectorModels($model); diff --git a/src/Netzmacht/Contao/Leaflet/Mapper/MapMapper.php b/src/Netzmacht/Contao/Leaflet/Mapper/MapMapper.php index cd2a94c..0e07d8b 100644 --- a/src/Netzmacht/Contao/Leaflet/Mapper/MapMapper.php +++ b/src/Netzmacht/Contao/Leaflet/Mapper/MapMapper.php @@ -11,15 +11,13 @@ namespace Netzmacht\Contao\Leaflet\Mapper; +use Netzmacht\Contao\Leaflet\Filter\Filter; use Netzmacht\Contao\Leaflet\Model\ControlModel; use Netzmacht\Contao\Leaflet\Model\MapModel; -use Netzmacht\JavascriptBuilder\Type\AnonymousFunction; -use Netzmacht\JavascriptBuilder\Type\Expression; use Netzmacht\LeafletPHP\Definition; use Netzmacht\LeafletPHP\Definition\Control; use Netzmacht\LeafletPHP\Definition\Layer; use Netzmacht\LeafletPHP\Definition\Map; -use Netzmacht\LeafletPHP\Definition\Type\LatLngBounds; /** * Class MapMapper maps the database map model to the leaflet definition. @@ -62,13 +60,13 @@ class MapMapper extends AbstractMapper Definition $map, \Model $model, DefinitionMapper $mapper, - LatLngBounds $bounds = null, + Filter $filter = null, Definition $parent = null ) { if ($map instanceof Map && $model instanceof MapModel) { $this->buildCustomOptions($map, $model); - $this->buildControls($map, $model, $mapper, $bounds); - $this->buildLayers($map, $model, $mapper, $bounds); + $this->buildControls($map, $model, $mapper, $filter); + $this->buildLayers($map, $model, $mapper, $filter); $this->buildBoundsCalculation($map, $model); $this->buildLocate($map, $model); } @@ -80,7 +78,7 @@ class MapMapper extends AbstractMapper protected function buildConstructArguments( \Model $model, DefinitionMapper $mapper, - LatLngBounds $bounds = null, + Filter $filter = null, $elementId = null ) { return array( @@ -110,11 +108,11 @@ class MapMapper extends AbstractMapper * @param Map $map The map being built. * @param MapModel $model The map model. * @param DefinitionMapper $mapper The definition mapper. - * @param LatLngBounds $bounds Optional bounds. + * @param Filter $filter Optional request filter. * * @return void */ - private function buildControls(Map $map, MapModel $model, DefinitionMapper $mapper, LatLngBounds $bounds = null) + private function buildControls(Map $map, MapModel $model, DefinitionMapper $mapper, Filter $filter = null) { $collection = ControlModel::findActiveBy('pid', $model->id, array('order' => 'sorting')); @@ -123,7 +121,7 @@ class MapMapper extends AbstractMapper } foreach ($collection as $control) { - $control = $mapper->handle($control, $bounds, null, $map); + $control = $mapper->handle($control, $filter, null, $map); if ($control instanceof Control) { $control->addTo($map); @@ -137,11 +135,11 @@ class MapMapper extends AbstractMapper * @param Map $map The map being built. * @param MapModel $model The map model. * @param DefinitionMapper $mapper Definition mapper. - * @param LatLngBounds $bounds Optional bounds. + * @param Filter $filter Optional request filter. * * @return void */ - private function buildLayers(Map $map, MapModel $model, DefinitionMapper $mapper, LatLngBounds $bounds = null) + private function buildLayers(Map $map, MapModel $model, DefinitionMapper $mapper, Filter $filter = null) { $collection = $model->findActiveLayers(); @@ -151,7 +149,7 @@ class MapMapper extends AbstractMapper continue; } - $layer = $mapper->handle($layer, $bounds, null, $map); + $layer = $mapper->handle($layer, $filter, null, $map); if ($layer instanceof Layer) { $layer->addTo($map); } diff --git a/src/Netzmacht/Contao/Leaflet/Mapper/Mapper.php b/src/Netzmacht/Contao/Leaflet/Mapper/Mapper.php index e7a3dee..8be57f1 100644 --- a/src/Netzmacht/Contao/Leaflet/Mapper/Mapper.php +++ b/src/Netzmacht/Contao/Leaflet/Mapper/Mapper.php @@ -11,8 +11,8 @@ namespace Netzmacht\Contao\Leaflet\Mapper; +use Netzmacht\Contao\Leaflet\Filter\Filter; use Netzmacht\LeafletPHP\Definition; -use Netzmacht\LeafletPHP\Definition\Type\LatLngBounds; /** * Interface Mapper describes the Mapper which translates a given configuration to the Leaflet definition. @@ -26,7 +26,7 @@ interface Mapper * * @param \Model|mixed $model The model being built. Usually a contao model, but can be anything. * @param DefinitionMapper $mapper The definition builder. - * @param LatLngBounds $bounds Optional bounds where elements should be in. + * @param Filter $filter Optional filter bounds. * @param string $elementId Optional element. * @param Definition|null $parent Optional passed parent. * @@ -35,7 +35,7 @@ interface Mapper public function handle( $model, DefinitionMapper $mapper, - LatLngBounds $bounds = null, + Filter $filter = null, $elementId = null, Definition $parent = null ); @@ -43,10 +43,10 @@ interface Mapper /** * Check if mapper is responsible for the model. * - * @param \Model $model The model being build. - * @param LatLngBounds $bounds Optional bounds where elements should be in. + * @param \Model $model The model being build. + * @param Filter $filter Optional filter bounds. * * @return bool */ - public function match($model, LatLngBounds $bounds = null); + public function match($model, Filter $filter = null); } diff --git a/src/Netzmacht/Contao/Leaflet/Mapper/Type/DivIconMapper.php b/src/Netzmacht/Contao/Leaflet/Mapper/Type/DivIconMapper.php index a7a8ab8..1f94240 100644 --- a/src/Netzmacht/Contao/Leaflet/Mapper/Type/DivIconMapper.php +++ b/src/Netzmacht/Contao/Leaflet/Mapper/Type/DivIconMapper.php @@ -11,10 +11,10 @@ namespace Netzmacht\Contao\Leaflet\Mapper\Type; +use Netzmacht\Contao\Leaflet\Filter\Filter; use Netzmacht\Contao\Leaflet\Mapper\DefinitionMapper; use Netzmacht\LeafletPHP\Definition; use Netzmacht\LeafletPHP\Definition\Type\DivIcon; -use Netzmacht\LeafletPHP\Definition\Type\LatLngBounds; /** * Class DivIconMapper maps the icon model to the div icon definition. @@ -54,10 +54,10 @@ class DivIconMapper extends AbstractIconMapper Definition $definition, \Model $model, DefinitionMapper $mapper, - LatLngBounds $bounds = null, + Filter $filter = null, Definition $parent = null ) { - parent::build($definition, $model, $mapper, $bounds); + parent::build($definition, $model, $mapper, $filter); if ($definition instanceof DivIcon && $model->iconSize) { $definition->setIconSize(explode(',', $model->iconSize, 2)); diff --git a/src/Netzmacht/Contao/Leaflet/Mapper/Type/ImageIconMapper.php b/src/Netzmacht/Contao/Leaflet/Mapper/Type/ImageIconMapper.php index 68dde93..75cfab8 100644 --- a/src/Netzmacht/Contao/Leaflet/Mapper/Type/ImageIconMapper.php +++ b/src/Netzmacht/Contao/Leaflet/Mapper/Type/ImageIconMapper.php @@ -11,11 +11,11 @@ namespace Netzmacht\Contao\Leaflet\Mapper\Type; +use Netzmacht\Contao\Leaflet\Filter\Filter; use Netzmacht\Contao\Leaflet\Mapper\DefinitionMapper; use Netzmacht\Contao\Leaflet\Model\IconModel; use Netzmacht\LeafletPHP\Definition; use Netzmacht\LeafletPHP\Definition\Type\ImageIcon; -use Netzmacht\LeafletPHP\Definition\Type\LatLngBounds; /** * Class ImageIconMapper maps the icon model to the image icon definition. @@ -44,10 +44,10 @@ class ImageIconMapper extends AbstractIconMapper protected function buildConstructArguments( \Model $model, DefinitionMapper $mapper, - LatLngBounds $bounds = null, + Filter $filter = null, $elementId = null ) { - $arguments = parent::buildConstructArguments($model, $mapper, $bounds, $elementId); + $arguments = parent::buildConstructArguments($model, $mapper, $filter, $elementId); if ($model->iconImage) { $file = \FilesModel::findByUuid($model->iconImage); @@ -67,7 +67,7 @@ class ImageIconMapper extends AbstractIconMapper Definition $definition, \Model $model, DefinitionMapper $mapper, - LatLngBounds $bounds = null, + Filter $filter = null, Definition $parent = null ) { if ($definition instanceof ImageIcon) { diff --git a/src/Netzmacht/Contao/Leaflet/Mapper/UI/MarkerMapper.php b/src/Netzmacht/Contao/Leaflet/Mapper/UI/MarkerMapper.php index 692acd9..ae24135 100644 --- a/src/Netzmacht/Contao/Leaflet/Mapper/UI/MarkerMapper.php +++ b/src/Netzmacht/Contao/Leaflet/Mapper/UI/MarkerMapper.php @@ -11,13 +11,13 @@ namespace Netzmacht\Contao\Leaflet\Mapper\UI; +use Netzmacht\Contao\Leaflet\Filter\Filter; use Netzmacht\Contao\Leaflet\Mapper\AbstractMapper; use Netzmacht\Contao\Leaflet\Mapper\DefinitionMapper; use Netzmacht\Contao\Leaflet\Model\IconModel; use Netzmacht\Contao\Leaflet\ServiceContainerTrait; use Netzmacht\LeafletPHP\Definition; use Netzmacht\LeafletPHP\Definition\Type\ImageIcon; -use Netzmacht\LeafletPHP\Definition\Type\LatLngBounds; use Netzmacht\LeafletPHP\Definition\UI\Marker; /** @@ -49,10 +49,10 @@ class MarkerMapper extends AbstractMapper protected function buildConstructArguments( \Model $model, DefinitionMapper $mapper, - LatLngBounds $bounds = null, + Filter $filter = null, $elementId = null ) { - $arguments = parent::buildConstructArguments($model, $mapper, $bounds, $elementId); + $arguments = parent::buildConstructArguments($model, $mapper, $filter, $elementId); $arguments[] = $model->coordinates ?: null; return $arguments; @@ -77,7 +77,7 @@ class MarkerMapper extends AbstractMapper Definition $definition, \Model $model, DefinitionMapper $mapper, - LatLngBounds $bounds = null, + Filter $filter = null, Definition $parent = null ) { if ($definition instanceof Marker) { diff --git a/src/Netzmacht/Contao/Leaflet/Mapper/Vector/AbstractVectorMapper.php b/src/Netzmacht/Contao/Leaflet/Mapper/Vector/AbstractVectorMapper.php index 406fa6a..bdc3187 100644 --- a/src/Netzmacht/Contao/Leaflet/Mapper/Vector/AbstractVectorMapper.php +++ b/src/Netzmacht/Contao/Leaflet/Mapper/Vector/AbstractVectorMapper.php @@ -12,13 +12,13 @@ namespace Netzmacht\Contao\Leaflet\Mapper\Vector; use Netzmacht\Contao\Leaflet\Definition\Style; +use Netzmacht\Contao\Leaflet\Filter\Filter; use Netzmacht\Contao\Leaflet\Mapper\AbstractTypeMapper; use Netzmacht\Contao\Leaflet\Mapper\DefinitionMapper; use Netzmacht\Contao\Leaflet\Model\StyleModel; use Netzmacht\Contao\Leaflet\ServiceContainerTrait; use Netzmacht\LeafletPHP\Definition; use Netzmacht\LeafletPHP\Definition\HasPopup; -use Netzmacht\LeafletPHP\Definition\Type\LatLngBounds; use Netzmacht\LeafletPHP\Definition\Vector\Path; /** @@ -44,10 +44,10 @@ class AbstractVectorMapper extends AbstractTypeMapper Definition $definition, \Model $model, DefinitionMapper $mapper, - LatLngBounds $bounds = null, + Filter $filter = null, Definition $parent = null ) { - parent::build($definition, $model, $mapper, $bounds); + parent::build($definition, $model, $mapper, $filter); if ($definition instanceof Path && $model->style) { $styleModel = StyleModel::findActiveByPk($model->style); diff --git a/src/Netzmacht/Contao/Leaflet/Mapper/Vector/CircleMapper.php b/src/Netzmacht/Contao/Leaflet/Mapper/Vector/CircleMapper.php index 4a19677..fd7e1a3 100644 --- a/src/Netzmacht/Contao/Leaflet/Mapper/Vector/CircleMapper.php +++ b/src/Netzmacht/Contao/Leaflet/Mapper/Vector/CircleMapper.php @@ -11,10 +11,10 @@ namespace Netzmacht\Contao\Leaflet\Mapper\Vector; +use Netzmacht\Contao\Leaflet\Filter\Filter; use Netzmacht\Contao\Leaflet\Mapper\DefinitionMapper; use Netzmacht\LeafletPHP\Definition; use Netzmacht\LeafletPHP\Definition\Type\LatLng; -use Netzmacht\LeafletPHP\Definition\Type\LatLngBounds; use Netzmacht\LeafletPHP\Definition\Vector\Circle; /** @@ -55,10 +55,10 @@ class CircleMapper extends AbstractVectorMapper Definition $definition, \Model $model, DefinitionMapper $mapper, - LatLngBounds $bounds = null, + Filter $filter = null, Definition $parent = null ) { - parent::build($definition, $model, $mapper, $bounds); + parent::build($definition, $model, $mapper, $filter); if ($definition instanceof Circle) { $definition->setLatLng(LatLng::fromString($model->coordinates)); diff --git a/src/Netzmacht/Contao/Leaflet/Mapper/Vector/CircleMarkerMapper.php b/src/Netzmacht/Contao/Leaflet/Mapper/Vector/CircleMarkerMapper.php index d7979de..01d0718 100644 --- a/src/Netzmacht/Contao/Leaflet/Mapper/Vector/CircleMarkerMapper.php +++ b/src/Netzmacht/Contao/Leaflet/Mapper/Vector/CircleMarkerMapper.php @@ -11,11 +11,7 @@ namespace Netzmacht\Contao\Leaflet\Mapper\Vector; -use Netzmacht\Contao\Leaflet\Mapper\DefinitionMapper; use Netzmacht\LeafletPHP\Definition; -use Netzmacht\LeafletPHP\Definition\Type\LatLng; -use Netzmacht\LeafletPHP\Definition\Type\LatLngBounds; -use Netzmacht\LeafletPHP\Definition\Vector\Circle; /** * Class CircleMarkerMapper maps the database model to the circle marker definition. diff --git a/src/Netzmacht/Contao/Leaflet/Mapper/Vector/MultiPolygonMapper.php b/src/Netzmacht/Contao/Leaflet/Mapper/Vector/MultiPolygonMapper.php index 975ae85..8f3e2a2 100644 --- a/src/Netzmacht/Contao/Leaflet/Mapper/Vector/MultiPolygonMapper.php +++ b/src/Netzmacht/Contao/Leaflet/Mapper/Vector/MultiPolygonMapper.php @@ -11,10 +11,9 @@ namespace Netzmacht\Contao\Leaflet\Mapper\Vector; +use Netzmacht\Contao\Leaflet\Filter\Filter; use Netzmacht\Contao\Leaflet\Mapper\DefinitionMapper; use Netzmacht\LeafletPHP\Definition; -use Netzmacht\LeafletPHP\Definition\Type\LatLng; -use Netzmacht\LeafletPHP\Definition\Type\LatLngBounds; use Netzmacht\LeafletPHP\Definition\Vector\MultiPolygon; /** @@ -45,10 +44,10 @@ class MultiPolygonMapper extends MultiPolylineMapper Definition $definition, \Model $model, DefinitionMapper $mapper, - LatLngBounds $bounds = null, + Filter $filter = null, Definition $parent = null ) { - parent::build($definition, $model, $mapper, $bounds); + parent::build($definition, $model, $mapper, $filter); if ($definition instanceof MultiPolygon) { $this->createLatLngs($definition, $model); diff --git a/src/Netzmacht/Contao/Leaflet/Mapper/Vector/MultiPolylineMapper.php b/src/Netzmacht/Contao/Leaflet/Mapper/Vector/MultiPolylineMapper.php index d529e62..73f7222 100644 --- a/src/Netzmacht/Contao/Leaflet/Mapper/Vector/MultiPolylineMapper.php +++ b/src/Netzmacht/Contao/Leaflet/Mapper/Vector/MultiPolylineMapper.php @@ -11,12 +11,11 @@ namespace Netzmacht\Contao\Leaflet\Mapper\Vector; +use Netzmacht\Contao\Leaflet\Filter\Filter; use Netzmacht\Contao\Leaflet\Mapper\DefinitionMapper; use Netzmacht\LeafletPHP\Definition; use Netzmacht\LeafletPHP\Definition\Type\LatLng; -use Netzmacht\LeafletPHP\Definition\Type\LatLngBounds; use Netzmacht\LeafletPHP\Definition\Vector\MultiPolyline; -use Netzmacht\LeafletPHP\Definition\Vector\Polyline; /** * Class MultiPolylineMapper maps the databse model it the multi polyline definition. @@ -46,10 +45,10 @@ class MultiPolylineMapper extends AbstractVectorMapper Definition $definition, \Model $model, DefinitionMapper $mapper, - LatLngBounds $bounds = null, + Filter $filter = null, Definition $parent = null ) { - parent::build($definition, $model, $mapper, $bounds); + parent::build($definition, $model, $mapper, $filter); if ($definition instanceof MultiPolyline) { $this->createLatLngs($definition, $model); diff --git a/src/Netzmacht/Contao/Leaflet/Mapper/Vector/PolylineMapper.php b/src/Netzmacht/Contao/Leaflet/Mapper/Vector/PolylineMapper.php index bc7fd3e..0b017a3 100644 --- a/src/Netzmacht/Contao/Leaflet/Mapper/Vector/PolylineMapper.php +++ b/src/Netzmacht/Contao/Leaflet/Mapper/Vector/PolylineMapper.php @@ -11,10 +11,10 @@ namespace Netzmacht\Contao\Leaflet\Mapper\Vector; +use Netzmacht\Contao\Leaflet\Filter\Filter; use Netzmacht\Contao\Leaflet\Mapper\DefinitionMapper; use Netzmacht\LeafletPHP\Definition; use Netzmacht\LeafletPHP\Definition\Type\LatLng; -use Netzmacht\LeafletPHP\Definition\Type\LatLngBounds; use Netzmacht\LeafletPHP\Definition\Vector\Polyline; /** @@ -45,10 +45,10 @@ class PolylineMapper extends AbstractVectorMapper Definition $definition, \Model $model, DefinitionMapper $mapper, - LatLngBounds $bounds = null, + Filter $filter = null, Definition $parent = null ) { - parent::build($definition, $model, $mapper, $bounds); + parent::build($definition, $model, $mapper, $filter); if ($definition instanceof Polyline) { array_map( diff --git a/src/Netzmacht/Contao/Leaflet/Mapper/Vector/RectangleMapper.php b/src/Netzmacht/Contao/Leaflet/Mapper/Vector/RectangleMapper.php index 2b9b120..b5332bc 100644 --- a/src/Netzmacht/Contao/Leaflet/Mapper/Vector/RectangleMapper.php +++ b/src/Netzmacht/Contao/Leaflet/Mapper/Vector/RectangleMapper.php @@ -11,12 +11,11 @@ namespace Netzmacht\Contao\Leaflet\Mapper\Vector; +use Netzmacht\Contao\Leaflet\Filter\Filter; use Netzmacht\Contao\Leaflet\Mapper\DefinitionMapper; use Netzmacht\LeafletPHP\Definition; use Netzmacht\LeafletPHP\Definition\Type\LatLng; use Netzmacht\LeafletPHP\Definition\Type\LatLngBounds; -use Netzmacht\LeafletPHP\Definition\Vector\Circle; -use Netzmacht\LeafletPHP\Definition\Vector\Rectangle; /** * Class RectangleMapper maps a database model to its rectangle vector definition. @@ -45,7 +44,7 @@ class RectangleMapper extends AbstractVectorMapper protected function buildConstructArguments( \Model $model, DefinitionMapper $mapper, - LatLngBounds $bounds = null, + Filter $filter = null, $elementId = null ) { $latLngs = array_map( @@ -55,7 +54,7 @@ class RectangleMapper extends AbstractVectorMapper deserialize($model->bounds, true) ); - $arguments = parent::buildConstructArguments($model, $mapper, $bounds, $elementId); + $arguments = parent::buildConstructArguments($model, $mapper, $filter, $elementId); $arguments[] = new LatLngBounds($latLngs[0], $latLngs[1]); return $arguments;