diff --git a/src/Netzmacht/Contao/Leaflet/Mapper/MapMapper.php b/src/Netzmacht/Contao/Leaflet/Mapper/MapMapper.php index 4da06bb..da2a7a2 100644 --- a/src/Netzmacht/Contao/Leaflet/Mapper/MapMapper.php +++ b/src/Netzmacht/Contao/Leaflet/Mapper/MapMapper.php @@ -118,7 +118,7 @@ class MapMapper extends AbstractMapper $control = $mapper->handle($control, $bounds); if ($control instanceof Control) { - $map->addControl($control); + $control->addTo($map); } } } @@ -145,7 +145,7 @@ class MapMapper extends AbstractMapper $layer = $mapper->handle($layer, $bounds); if ($layer instanceof Layer) { - $map->addLayer($layer); + $layer->addTo($map); } } }