From 30be28b8e3a2143db8a69c873cdaed56dfc0e6e0 Mon Sep 17 00:00:00 2001 From: Guilhem Moulin Date: Wed, 31 Jan 2024 07:02:43 +0100 Subject: Add layer for gigafactories (own drawing). --- example.html | 2 +- main.js | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+), 1 deletion(-) diff --git a/example.html b/example.html index 31bd0f1..c3129a3 100644 --- a/example.html +++ b/example.html @@ -23,6 +23,6 @@ knappen uppe till höger så öpnar hela kartan i en ny flik. Där kan man välja lager, ladda ner kartan som PNG-fil, och få information om de olika föremålen.

- + diff --git a/main.js b/main.js index f48f6a6..fb5d0ad 100644 --- a/main.js +++ b/main.js @@ -1384,6 +1384,49 @@ const layers = { }); }), }, + + gigafactories: { + popoverTitle: 'Stor industrisatsning', + popover: [ + ['Namn', 'name'], + ['Länk', 'url', { fn: function(v) { + const a = document.createElement('a'); + a.href = v; + a.target = '_blank'; + const i = document.createElement('i'); + i.classList.add('bi', 'bi-box-arrow-up-right'); + a.appendChild(i); + return a; + }}], + ], + style: [4, 6, 7, 8, 10, 12].map(function(width) { + return new Style({ + zIndex: 60, + image: new CircleStyle({ + radius: width, + fill: new Fill({ + color: 'rgb(152, 78, 163)', + }), + stroke: new Stroke({ + width: Math.log2(width) * 2/5, + color: 'rgb(119, 61, 128)', + }), + }), + }); + }) + .concat([1.5, 2, 2, 2, 2, 2].map(function(width) { + return new Style({ + zIndex: 58, + fill: new Fill({ + color: 'rgba(152, 78, 163, .4)', + }), + stroke: new Stroke({ + width: width, + color: 'rgb(119, 61, 128)', + }), + }); + })), + } }; const layerHierarchy = [ @@ -1404,6 +1447,10 @@ const layerHierarchy = [ }, ], }, + { + text: 'Sora industrisatsningar', + layer: 'gigafactories', + }, { text: 'Dammar', layer: 'smhi_dam', -- cgit v1.2.3