[guadec-web] Added OSM maps support using leaflet



commit fa0984cabbfad3809d1184fa9a7da2de6d879e69
Author: Oliver Gutierrez <ogutsua gmail com>
Date:   Thu Jun 7 10:40:39 2018 +0100

    Added OSM maps support using leaflet

 content/pages/test-map.md | 17 +++++++++++++++++
 src/haml/base/base.haml   | 11 +++++++++++
 2 files changed, 28 insertions(+)
---
diff --git a/content/pages/test-map.md b/content/pages/test-map.md
new file mode 100644
index 0000000..b276b67
--- /dev/null
+++ b/content/pages/test-map.md
@@ -0,0 +1,17 @@
+Title: Test map
+Date: 20180219
+
+## OSM Map test with leaflet
+
+<div id="map" style="width: 100%; height: 600px;"></div>
+<script>
+    var map = L.map('map').setView([36.8429, -2.4415], 14);
+
+    L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
+        attribution: '&copy; <a href="https://www.openstreetmap.org/copyright";>OpenStreetMap</a> 
contributors'
+    }).addTo(map);
+
+    L.marker([36.83604, -2.44778]).addTo(map)
+        .bindPopup('MARKER TEXT INFO')
+        // .openPopup();
+</script>
diff --git a/src/haml/base/base.haml b/src/haml/base/base.haml
index cfec744..27982cb 100644
--- a/src/haml/base/base.haml
+++ b/src/haml/base/base.haml
@@ -41,6 +41,17 @@
         %link{:rel => "apple-touch-icon-precompose", :href => "{{ SITEURL }}/theme/img/icon-180x180.png"}
         %link{:rel => "msapplication-TileImage", :href => "{{ SITEURL }}/theme/img/icon-270x270.png"}
 
+        -# Leaflet stylesheet
+        %link{:rel => "stylesheet",
+            :href => "https://unpkg.com/leaflet@1.3.1/dist/leaflet.css";,
+            :integrity => 
"sha512-Rksm5RenBEKSKFjgI3a41vrjkw4EVPlJ3+OiI65vTjIdo9brlAacEuKOiQ5OFh7cOI1bkDwLqdLw3Zg0cRJAAQ==",
+            :crossorigin => ""}
+        -# Leaflet scripts
+        %script{:src => "https://unpkg.com/leaflet@1.3.1/dist/leaflet.js";,
+            :integrity => 
"sha512-/Nsx9X4HebavoBvEBuyp3I7od5tA0UzAxs+j83KgC8PU0kgB4XiK4Lfe4y4cgBtaRJQEIFCW+oC506aPT2L1zw==",
+            :crossorigin => ""}
+
+
         %link{:rel => "stylesheet", :href => "{{ SITEURL }}/theme/css/screen.css"}
 
         /[if lt IE 9]


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]