mirror of
https://github.com/netzmacht/contao-leaflet-maps.git
synced 2025-12-01 12:33:45 +01:00
Use template engine to render the map.
This commit is contained in:
@@ -16,6 +16,7 @@ services:
|
||||
- '@netzmacht.contao_leaflet.cache'
|
||||
- '@netzmacht.contao_leaflet.frontend.data_controller'
|
||||
- '@netzmacht.contao_toolkit.repository_manager'
|
||||
- '@templating'
|
||||
|
||||
netzmacht.contao_leaflet.libraries:
|
||||
class: Netzmacht\Contao\Leaflet\Frontend\Assets\LibrariesConfiguration
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<div id="<?php echo $mapId; ?>" style="<?php echo $style; ?>"></div>
|
||||
<div id="<?= $this->mapId ?>" style="<?= $this->style ?>"></div>
|
||||
<script>
|
||||
L.contao.addMap('<?php echo $mapId; ?>', function () {
|
||||
<?php echo $javascript; ?>
|
||||
L.contao.addMap('<?= $this->mapId ?>', function () {
|
||||
<?= $this->javascript ?>
|
||||
return {map: map, layers: layers, controls: controls, icons: icons};
|
||||
}());</script>
|
||||
}());
|
||||
</script>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
L.contao.addMap('<?php echo $mapId; ?>', function() {
|
||||
<?php echo $javascript; ?>
|
||||
L.contao.addMap('<?= $this->mapId ?>', function() {
|
||||
<?= $this->javascript ?>
|
||||
|
||||
return { map: map, layers: layers, controls: controls, icons: icons };
|
||||
}());
|
||||
|
||||
Reference in New Issue
Block a user