forked from Snck3rs/contao-leaflet-maps
Implement an insert tag.
This commit is contained in:
@@ -13,6 +13,7 @@ TemplateLoader::addFiles(
|
||||
array(
|
||||
'ce_leaflet_map' => 'system/modules/leaflet/templates',
|
||||
'leaflet_map_js' => 'system/modules/leaflet/templates',
|
||||
'leaflet_map_html' => 'system/modules/leaflet/templates',
|
||||
'mod_leaflet_map' => 'system/modules/leaflet/templates',
|
||||
'be_leaflet_geocode' => 'system/modules/leaflet/templates',
|
||||
'be_leaflet_credits' => 'system/modules/leaflet/templates',
|
||||
|
||||
@@ -61,6 +61,10 @@ $GLOBALS['TL_CTE']['includes']['leaflet'] = 'Netzmacht\Contao\Leaflet\Frontend\M
|
||||
*/
|
||||
$GLOBALS['FE_MOD']['includes']['leaflet'] = 'Netzmacht\Contao\Leaflet\Frontend\MapModule';
|
||||
|
||||
/*
|
||||
* Hooks
|
||||
*/
|
||||
$GLOBALS['TL_HOOKS']['replaceInsertTags'][] = array('Netzmacht\Contao\Leaflet\Frontend\Hooks', 'replaceInsertTags');
|
||||
|
||||
/*
|
||||
* Models.
|
||||
|
||||
@@ -6,11 +6,6 @@
|
||||
<?php endif; ?>
|
||||
|
||||
<div id="<?php echo $this->mapId; ?>" style="<?php echo $this->mapStyle; ?>"></div>
|
||||
<?php if ($this->map): ?>
|
||||
<script>
|
||||
<?php echo $this->map; ?>
|
||||
</script>
|
||||
<?php endif; ?>
|
||||
|
||||
</div>
|
||||
<!-- indexer::continue -->
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
<div id="<?php echo $mapId; ?>"></div>
|
||||
<div id="<?php echo $mapId; ?>" style="<?php echo $style; ?>"></div>
|
||||
<?php $GLOBALS['TL_BODY'][] = <<<HTML
|
||||
<script>
|
||||
<?php include \Controller::getTemplate('leaflet_map_js'); ?>
|
||||
</script>
|
||||
ContaoLeaflet.addMap('{$mapId}', function() {
|
||||
{$javascript}
|
||||
return { map: map, layers: layers, controls: controls, icons: icons };
|
||||
}());</script>
|
||||
HTML;
|
||||
|
||||
Reference in New Issue
Block a user