Skip to content

Instantly share code, notes, and snippets.

@akroii
Created July 2, 2021 13:33
Show Gist options
  • Save akroii/8f1465c1a1556c27a47328ce053fcd01 to your computer and use it in GitHub Desktop.
Save akroii/8f1465c1a1556c27a47328ce053fcd01 to your computer and use it in GitHub Desktop.
<?php $GLOBALS['TL_JAVASCRIPT'][] = $GLOBALS['TL_CONFIG']['uploadPath'] . '/assets/js/leaflet.js|static';?>
<?php #$GLOBALS['TL_JAVASCRIPT'][] = $GLOBALS['TL_CONFIG']['uploadPath'] . '/assets/js/Leaflet.fullscreen.min.js|static';?>
<?php $GLOBALS['TL_CSS'][] = $GLOBALS['TL_CONFIG']['uploadPath'] . '/assets/css/leaflet.css|static';?>
<?php #$GLOBALS['TL_CSS'][] = $GLOBALS['TL_CONFIG']['uploadPath'] . '/assets/css/leaflet.fullscreen.css|static';?>
<?php $GLOBALS['TL_BODY'][] = "
<script>
var mymap = L.map('map').setView([51.xx, 11.xx], 16);
L.tileLayer('https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token=pk.eyJ1IjoibWFwYm94IiwiYSI6ImNpejY4NXVycTA2emYycXBndHRqcmZ3N3gifQ.rJcFIG214AriISLbB6B5aw', {
attribution: 'Map data &copy; <a href=\"https://www.openstreetmap.org/\">OpenStreetMap</a> contributors, ' +
'<a href=\"https://creativecommons.org/licenses/by-sa/2.0/\">CC-BY-SA</a>, ' +
'Imagery © <a href=\"https://www.mapbox.com/\">Mapbox</a>',
id: 'mapbox/satellite-v9',
tileSize: 512,
zoomOffset: -1
}).addTo(mymap);
L.marker([51.xx,11.xx]).addTo(mymap).bindPopup(\"<strong>gf</strong><br /><a target='_blank' href='e'></a>\").openPopup();
mymap.scrollWheelZoom.disable();
L.control.scale().addTo(mymap);
</script>
";?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment