Hello everyone,
I want to display a map on some of my wiki-pages (ok, that are more than only some pages, I will assume around 1500 - 2000).
I know about the openlayersmap-plugin, but this doesn't suit my needs. I want to use this code from leaflet:
<div id="mapid" style="width: 600px; height: 500px;"></div>
<script>
var mymap = L.map('mapid').setView([<?php echo $lat ?>, <?php echo $lon ?>], 15);
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
maxZoom: 18,
attribution: 'Map data © <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors, ' +
'<a href="https://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>',
id: 'osm.streets'
}).addTo(mymap);
L.circle([<?php echo $lat ?>, <?php echo $lon ?>], 100, {
color: 'red',
fillColor: '#f03',
fillOpacity: 0.3
}).addTo(mymap).bindPopup("Text for tooltip.");
</script>
and on the different pages, there are always $lat and $lon which should be replaced by the given coordinates.
The pages are initally created by a script, so it would work to put the code with the coordinates replaced by the script between <HTML> and </HTML>, because HTML is activated (we will be a small group of 3 authors which trust each other).
But I don't like the way to put the whole code on every page, because if in the future there have to be changes to that code, I will have to touch every page.
The nicest solution would be a syntax plugin where I could type {{map&49.123&8.123}} to get a map with the two coordinates filled.
But does anybody has an idea if there is another way than writing an own plugin for this? I've already written two small plugins, but this is hard work for me and it would be great if my goal can be achieved on an easier way. The coordinates for every page are stored via the data-plugin, if this helps.
Alternativly, does someone know a very very simple syntax plugin which does nothing else than such a variable replace? I've searched many of the syntax plugins, but they all look so complicated.
Greetings,
Christoph