From fa672674730ab7a942bc9f34e71247e6ce6a34a6 Mon Sep 17 00:00:00 2001 From: David Molineus Date: Thu, 6 Oct 2016 12:31:21 +0200 Subject: [PATCH] Output the map javscript in the template. --- module/templates/ce_leaflet_map.html5 | 1 + module/templates/mod_leaflet_map.html5 | 2 +- src/Netzmacht/Contao/Leaflet/Frontend/AbstractMapHybrid.php | 3 +-- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/module/templates/ce_leaflet_map.html5 b/module/templates/ce_leaflet_map.html5 index df6a289..61563ff 100644 --- a/module/templates/ce_leaflet_map.html5 +++ b/module/templates/ce_leaflet_map.html5 @@ -9,4 +9,5 @@ +' . $this->javascript .''; ?> diff --git a/module/templates/mod_leaflet_map.html5 b/module/templates/mod_leaflet_map.html5 index e88bc5b..ff792c9 100644 --- a/module/templates/mod_leaflet_map.html5 +++ b/module/templates/mod_leaflet_map.html5 @@ -14,4 +14,4 @@ - +' . $this->javascript .''; ?> diff --git a/src/Netzmacht/Contao/Leaflet/Frontend/AbstractMapHybrid.php b/src/Netzmacht/Contao/Leaflet/Frontend/AbstractMapHybrid.php index 795fcee..ad04a26 100644 --- a/src/Netzmacht/Contao/Leaflet/Frontend/AbstractMapHybrid.php +++ b/src/Netzmacht/Contao/Leaflet/Frontend/AbstractMapHybrid.php @@ -120,8 +120,7 @@ abstract class AbstractMapHybrid extends AbstractHybrid $mapId = $this->getIdentifier(); $map = $this->mapProvider->generate($this->get('leaflet_map'), null, $mapId, $template); - $GLOBALS['TL_BODY'][] = ''; - + $this->template->set('javascript', $map); $this->template->set('mapId', $mapId); $style = '';