From c25b25936d427a4b8fdbaa35ebb8e4878bf217cb Mon Sep 17 00:00:00 2001 From: codecalm Date: Thu, 20 Feb 2020 21:33:54 +0100 Subject: [PATCH] maps components, mapbox, small fixes --- _config.yml | 2 + build/copy-libs.js | 8 ++- pages/_data/libs.json | 6 +- pages/_data/maps-vector.yml | 1 - pages/_data/maps.yml | 15 ++++ pages/_data/menu.yml | 6 ++ pages/_includes/cards/map.html | 2 +- pages/_includes/layout/css.html | 2 +- pages/_includes/layout/footer.html | 22 +++--- pages/_includes/layout/js.html | 2 +- pages/_includes/layout/navbar-secondary.html | 2 +- pages/_includes/ui/chart.html | 2 +- pages/_includes/ui/map-vector.html | 75 +++++++++++--------- pages/_includes/ui/map.html | 31 ++++++++ pages/maps-vector.html | 26 +++---- pages/maps.html | 27 +++++++ scss/_variables.scss | 59 ++++++++------- scss/layout/_navbar.scss | 42 ++++------- 18 files changed, 207 insertions(+), 123 deletions(-) diff --git a/_config.yml b/_config.yml index 14bca799..72a7e8b7 100644 --- a/_config.yml +++ b/_config.yml @@ -7,6 +7,8 @@ description: Premium and Open Source dashboard template with responsive and high github_url: https://github.com/tabler/tabler sponsor_url: https://github.com/sponsors/codecalm +mapbox_key: pk.eyJ1IjoiY29kZWNhbG0iLCJhIjoiSzRiOVJvQSJ9.BUVkTT6IYs83xSUs4H7bjQ + debug: false dark-theme: false diff --git a/build/copy-libs.js b/build/copy-libs.js index 1ad99194..ee80c949 100755 --- a/build/copy-libs.js +++ b/build/copy-libs.js @@ -26,8 +26,10 @@ Object.keys(all_libs.css).forEach(function (lib) { files = files.flat(); files.forEach(function (file) { - let dirname = path.dirname(file).replace('@', ''); - let cmd = `mkdir -p "dist/libs/${dirname}" && cp -r node_modules/${file} dist/libs/${file.replace('@', '')}`; + if(! file.match(/^https?/)) { + let dirname = path.dirname(file).replace('@', ''); + let cmd = `mkdir -p "dist/libs/${dirname}" && cp -r node_modules/${file} dist/libs/${file.replace('@', '')}`; - exec(cmd) + exec(cmd) + } }); diff --git a/pages/_data/libs.json b/pages/_data/libs.json index 4d65ac28..d3b99bcd 100644 --- a/pages/_data/libs.json +++ b/pages/_data/libs.json @@ -27,7 +27,8 @@ "flatpickr/dist/flatpickr.min.js", "flatpickr/dist/plugins/rangePlugin.js" ], - "nouislider": "nouislider/distribute/nouislider.min.js" + "nouislider": "nouislider/distribute/nouislider.min.js", + "mapbox": "https://api.mapbox.com/mapbox-gl-js/v1.8.0/mapbox-gl.js" }, "css": { "jqvmap": "jqvmap/dist/jqvmap.min.css", @@ -39,6 +40,7 @@ "@fullcalendar/list/main.min.css" ], "flatpickr": "flatpickr/dist/flatpickr.min.css", - "nouislider": "nouislider/distribute/nouislider.min.css" + "nouislider": "nouislider/distribute/nouislider.min.css", + "mapbox": "https://api.mapbox.com/mapbox-gl-js/v1.8.0/mapbox-gl.css" } } diff --git a/pages/_data/maps-vector.yml b/pages/_data/maps-vector.yml index 78123d36..29c51d73 100644 --- a/pages/_data/maps-vector.yml +++ b/pages/_data/maps-vector.yml @@ -9,7 +9,6 @@ europe: map: europe_en zoom: true - usa: title: Map of USA map: usa_en diff --git a/pages/_data/maps.yml b/pages/_data/maps.yml index e69de29b..07aee182 100644 --- a/pages/_data/maps.yml +++ b/pages/_data/maps.yml @@ -0,0 +1,15 @@ +simple: + title: Simple map + +light: + title: Light map style + center: [51.5285582, -0.2416782] + zoom: 11 + style: light-v10 + +card: + title: Light map style + center: [0, 0] + zoom: 1 + style: satellite-v9 + card: true \ No newline at end of file diff --git a/pages/_data/menu.yml b/pages/_data/menu.yml index cca3d1fe..b2466c11 100644 --- a/pages/_data/menu.yml +++ b/pages/_data/menu.yml @@ -29,6 +29,12 @@ base: modals: url: modals.html title: Modals + maps: + url: maps.html + title: Maps + maps-vector: + url: maps-vector.html + title: Vector maps charts: url: charts.html title: Charts diff --git a/pages/_includes/cards/map.html b/pages/_includes/cards/map.html index 2be93e4d..22e734a1 100644 --- a/pages/_includes/cards/map.html +++ b/pages/_includes/cards/map.html @@ -4,6 +4,6 @@ {% if include.title %}

{{ include.title }}

{% endif %} - {% include ui/map.html map-id=map color="blue" height=15 %} + {% include ui/map-vector.html map-id=map color="blue" height=15 %} diff --git a/pages/_includes/layout/css.html b/pages/_includes/layout/css.html index c145151d..628339a0 100644 --- a/pages/_includes/layout/css.html +++ b/pages/_includes/layout/css.html @@ -2,7 +2,7 @@ {% for lib in site.data.libs.css %} {% for file in lib[1] %} - + {% endfor %} {% endfor %} {% endif %} diff --git a/pages/_includes/layout/footer.html b/pages/_includes/layout/footer.html index 65ff4330..cb90809c 100644 --- a/pages/_includes/layout/footer.html +++ b/pages/_includes/layout/footer.html @@ -1,20 +1,14 @@