summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorSiri Reiter <siri@jones.dk>2018-05-16 20:58:35 +0200
committerSiri Reiter <siri@jones.dk>2018-05-16 20:59:23 +0200
commitea0401d31daf3bc9bbd70c7de5c15ec448403dcf (patch)
tree41f8b2dfcf6180d0f1c9e758198e926ee88d2733 /templates
parent30d7b704a6b57752e169a7adcd3d505e26a27912 (diff)
Use requirejs based compiled map.
Diffstat (limited to 'templates')
-rw-r--r--templates/map.mdwn42
1 files changed, 1 insertions, 41 deletions
diff --git a/templates/map.mdwn b/templates/map.mdwn
index f3b907b1..8d0a0030 100644
--- a/templates/map.mdwn
+++ b/templates/map.mdwn
@@ -1,44 +1,4 @@
[[!meta stylesheet=map rel="stylesheet"]]
<div id="map"></div>
-<script src="/usr/share/javascript/leaflet/leaflet.js"></script>
-<script><TMPL_IF stamen>
-var attribOSM = 'Kartografi &copy; <a href="https://stamen.com/">Stamen Design</a>'
- +' under en <a href="https://creativecommons.org/licenses/by/3.0">Creative Commons Kreditering</a> licens.'
- +' Data &copy; <a href="https://www.openstreetmap.org/copyright#contributors">OpenStreetMap-bidragydere</a>'
- +' under <a href="http://opendatacommons.org/licenses/odbl/">ODbL</a> licens';
-var OSMLayer = L.tileLayer('https://stamen-tiles.a.ssl.fastly.net/<TMPL_VAR stamen>/{z}/{x}/{y}.png', { attribution: attribOSM } );<TMPL_ELSE><TMPL_IF stamen-old>
-var attribOSM = 'Kartografi &copy; <a href="https://stamen.com/">Stamen Design</a>'
- +' under en <a href="https://creativecommons.org/licenses/by/3.0">Creative Commons Kreditering</a> licens.'
- +' Data &copy; <a href="https://www.openstreetmap.org/copyright#contributors">OpenStreetMap-bidragydere</a>'
- +' under en <a href="http://creativecommons.org/licenses/by-sa/3.0">Creative Commons Kreditering-DelPåSammeVilkår</a> licens';
-var OSMLayer = L.tileLayer('https://stamen-tiles.a.ssl.fastly.net/<TMPL_VAR stamen-old>/{z}/{x}/{y}.png', { attribution: attribOSM } );<TMPL_ELSE>
-var attribOSM = 'Kartografi &copy; <a href="https://www.openstreetmap.org/copyright#contributors">OpenStreetMap-bidragydere</a>'
- +' under en <a href="https://creativecommons.org/licenses/by-sa/2.0/">Creative Commons Kreditering-DelPåSammeVilkår</a> licens.'
- +' Data &copy; <a href="http://osmfoundation.org/">OpenStreetMap Foundation</a>'
- +' under <a href="http://opendatacommons.org/licenses/odbl/">ODbL</a> licens';
-var OSMLayer = L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { attribution: attribOSM } );</TMPL_IF></TMPL_IF>
-var Box = L.latLngBounds( [[<TMPL_VAR bounds-nw>],[<TMPL_VAR bounds-se>]] );
-var map = L.map('content', { layers: [OSMLayer] }).fitBounds(Box);
-map.attributionControl.setPrefix(false);
-
-L.control.scale({ imperial: false }).addTo(map);
-L.Icon.Default.imagePath = '/usr/share/javascript/leaflet/images/';
-
-<TMPL_IF positionpopup>
-function round(n,d) {
- return Math.round(Math.pow(10,d)*n)/Math.pow(10,d)
-};
-function latLngString(latLng) {
- return round(latLng.lat,5) + ", " + round(latLng.lng,5)
-};
-var popup = L.popup();
-function positionPopup(e) {
- popup
- .setLatLng(e.latlng)
- .setContent("Position (lat, long):<br>" + latLngString(e.latlng))
- .openOn(map);
-}
-map.on('contextmenu', positionPopup);
-</TMPL_IF>
-</script>
+<script src="js/lib/require.js" data-main="js/tours" type="text/javascript"></script>