Ongoing development.

This commit is contained in:
David Molineus
2015-01-06 14:55:53 +01:00
parent dfb558b655
commit e9d1ec7081
32 changed files with 1050 additions and 95 deletions

View File

@@ -14,6 +14,7 @@ namespace Netzmacht\Contao\Leaflet\Mapper\Control;
use Netzmacht\Contao\Leaflet\Mapper\DefinitionMapper;
use Netzmacht\LeafletPHP\Definition;
use Netzmacht\LeafletPHP\Definition\Control\Attribution;
use Netzmacht\LeafletPHP\Definition\Type\LatLngBounds;
/**
* AttributionControlMapper maps the the attribution database definition to the definition class.
@@ -49,7 +50,7 @@ class AttributionControlMapper extends AbstractControlMapper
/**
* {@inheritdoc}
*/
protected function doBuild(Definition $definition, \Model $model, DefinitionMapper $builder)
protected function doBuild(Definition $definition, \Model $model, DefinitionMapper $builder, LatLngBounds $bounds = null)
{
if (!$definition instanceof Attribution) {
return;

View File

@@ -14,6 +14,7 @@ namespace Netzmacht\Contao\Leaflet\Mapper\Control;
use Netzmacht\Contao\Leaflet\Mapper\DefinitionMapper;
use Netzmacht\Contao\Leaflet\Model\LayerModel;
use Netzmacht\LeafletPHP\Definition\Type\LatLngBounds;
class LayersControlMapper extends AbstractControlMapper
{
@@ -31,9 +32,9 @@ class LayersControlMapper extends AbstractControlMapper
*/
protected static $type = 'layers';
protected function buildConstructArguments(\Model $model, DefinitionMapper $mapper)
protected function buildConstructArguments(\Model $model, DefinitionMapper $mapper, LatLngBounds $bounds = null)
{
$arguments = parent::buildConstructArguments($model, $mapper);
$arguments = parent::buildConstructArguments($model, $mapper, $bounds);
$arguments[1] = array();
$arguments[2] = array();
@@ -44,7 +45,7 @@ class LayersControlMapper extends AbstractControlMapper
foreach ($collection as $layer) {
$argument = ($definition[$layer->id] === 'overlay') ? 2 : 1;
$arguments[$argument][] = $mapper->handle($layer);
$arguments[$argument][] = $mapper->handle($layer, $bounds);
}
}