Add option to replace default attribution control.

This commit is contained in:
David Molineus
2015-01-22 16:17:21 +01:00
parent 99daeac4fb
commit f68f623288
3 changed files with 17 additions and 1 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\Map;
use Netzmacht\LeafletPHP\Definition\Type\LatLngBounds;
/**
@@ -61,6 +62,10 @@ class AttributionControlMapper extends AbstractControlMapper
return;
}
if ($model->disableDefault && $parent instanceof Map) {
$parent->setAttributionControl(false);
}
$attributions = deserialize($model->attributions, true);
foreach ($attributions as $attribution) {