Custom Service Configuration

Leaflet & Openstreetmap

First of all Include leaflet and Openstreetmap like you wish in Typo3.

Add the attribute data-service="leaflet" to the script. Add the attribute type="text/plain to the script. Ensure that the service with the identifier leaflet exists and is enabled.

You can now Include the Script in any Place of your HTML Dom. The Cookie Manager hooks it on Consent accept.

<script type="text/plain" data-service="leaflet" src=""></script>

For an quick an dirty way to test use this code.


 <link rel="stylesheet" href="" integrity="sha256-kLaT2GOSpHechhsozzB+flnD+zUyjE2LlfWPgU04xyI=" crossorigin=""/>
 <script type="text/plain"  data-service="leaflet" src="" integrity="sha256-WBkoXOwTeyKclOHuWtc+i2uENFpDZ9YPdf5Hf+D7ewM=" crossorigin=""></script>

 <script type="text/plain" data-service="leaflet">

     const map ='makemerandom').setView([51.505, -0.09], 13);
     const tiles = L.tileLayer('{z}/{x}/{y}.png', {
         maxZoom: 19,
         attribution: '&copy; <a href="">OpenStreetMap</a>'

     const marker = L.marker([51.5, -0.09]).addTo(map)
         .bindPopup('<b>Hello world!</b><br />I am a popup.').openPopup();

     const circle =[51.508, -0.11], {
         color: 'red',
         fillColor: '#f03',
         fillOpacity: 0.5,
         radius: 500
     }).addTo(map).bindPopup('I am a circle.');

     const polygon = L.polygon([
         [51.509, -0.08],
         [51.503, -0.06],
         [51.51, -0.047]
     ]).addTo(map).bindPopup('I am a polygon.');

     const popup = L.popup()
         .setLatLng([51.513, -0.09])
         .setContent('I am a standalone popup.')

     function onMapClick(e) {
             .setContent(`You clicked the map at ${e.latlng.toString()}`)

     map.on('click', onMapClick);