aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuilhem Moulin <guilhem@fripost.org>2024-01-31 07:02:43 +0100
committerGuilhem Moulin <guilhem@fripost.org>2024-01-31 07:15:47 +0100
commit30be28b8e3a2143db8a69c873cdaed56dfc0e6e0 (patch)
tree9135490ed07ed188fdeff081dfcad07041474e2f
parentfff0407ca9148df17f627c6f7f956194bb1328f7 (diff)
Add layer for gigafactories (own drawing).
-rw-r--r--example.html2
-rw-r--r--main.js47
2 files changed, 48 insertions, 1 deletions
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.</p>
- <iframe src="/#z=0&basemap=topowebb_nedtonad&layers=svk_lines+svk_pylons+svk_stations+svk_planned+mrr_appr_ec+mrr_appl_ec+mrr_appr_ogd+mrr_appl_ogd+mrr_appr_met+mrr_appl_met+mrr_appr_dl+mrr_appr_pc+vbk_area_current+vbk_station_completed+vbk_station_processed+vbk_station_approved" title="Webbkarta" width=500 height=600></iframe>
+ <iframe src="/#z=0&basemap=topowebb_nedtonad&layers=svk_lines+svk_pylons+svk_stations+svk_planned+mrr_appr_ec+mrr_appl_ec+mrr_appr_ogd+mrr_appl_ogd+mrr_appr_met+mrr_appl_met+mrr_appr_dl+mrr_appr_pc+vbk_area_current+vbk_station_completed+vbk_station_processed+vbk_station_approved+gigafactories" title="Webbkarta" width=500 height=600></iframe>
</body>
</html>
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 = [
@@ -1405,6 +1448,10 @@ const layerHierarchy = [
],
},
{
+ text: 'Sora industrisatsningar',
+ layer: 'gigafactories',
+ },
+ {
text: 'Dammar',
layer: 'smhi_dam',
},