diff options
Diffstat (limited to 'main.js')
-rw-r--r-- | main.js | 276 |
1 files changed, 272 insertions, 4 deletions
@@ -502,6 +502,221 @@ view.on('change', function(event) { const layers = { + mrr_appr_ec: { + popoverTitle: 'Bearbetningskoncession \u2013 beviljad', + popover: [ + ['Namn', 'Name'], + ['Koncessionsmineral', 'Mineral'], + ['Ägare', 'Owner'], + ['Area', 'Area'], + ['Giltig från', 'Valid from'], + ['Giltig till', 'Valid to'], + ['Diary nr', 'Diary nr', { classes: ['feature-attr-dnr'] }], + ['Kommun', 'Municipality'], + ['Län', 'County'], + ['Senast uppdaterad', 'Last updated'], + ], + style: [0, .1, .5, .5, 1, 1.5, 2, 2.5, 3, 3.5, 4, 5].map(function(width, z) { + return new Style({ + zIndex: 22, + fill: new Fill({ + color: [247, 170, 67, Math.max((.2-1)/8 * z + 1, 0)], + }), + stroke: width === 0 ? undefined : new Stroke({ + width: width, + color: [151, 173, 23, 1], + }), + }); + }), + }, + mrr_appl_ec: { + popoverTitle: 'Bearbetningskoncession \u2013 ansökt', + popover: [ + ['Namn', 'Name'], + ['Koncessionsmineral', 'Mineral'], + ['Sökande', 'Applicant'], + ['Area', 'Area'], + ['Ansökningsdatum', 'Application date'], + ['Diary nr', 'Diary nr', { classes: ['feature-attr-dnr'] }], + ['Kommun', 'Municipality'], + ['Län', 'County'], + ['Senast uppdaterad', 'Last updated'], + ], + style: [0, .1, .5, .5, 1, 1.5, 2, 2.5, 3, 3.5, 4, 5].map(function(width, z) { + return new Style({ + zIndex: 25, + fill: new Fill({ + color: [247, 170, 67, Math.max((.2-1)/8 * z + 1, 0)], + }), + stroke: width === 0 ? undefined : new Stroke({ + width: width, + color: [197, 14, 31, 1], + lineDash: width >= 1.5 ? [2 * width] : undefined, + }), + }); + }), + }, + mrr_appr_met: { + popoverTitle: 'Undersökningstillstånd, metaller och industrimineral \u2013 beviljad', + popover: [ + ['Namn', 'Name'], + ['Koncessionsmineral', 'Mineral'], + ['Ägare', 'Owner'], + ['Licence id', 'Licence id', { classes: ['feature-attr-mrr-license-id'] }], + ['Area', 'Area'], + ['Giltig från', 'Valid from'], + ['Giltig till', 'Valid to'], + ['Diary nr', 'Diary nr', { classes: ['feature-attr-dnr'] }], + ['Kommun', 'Municipality'], + ['Län', 'County'], + ['Senast uppdaterad', 'Last updated'], + ], + style: [0, .1, .5, .5, 1, 1.5, 2, 2.5, 3, 3.5, 4, 5].map(function(width, z) { + return new Style({ + zIndex: 24, + fill: new Fill({ + color: [0, 0, 0, Math.max((.2-.4)/4 * z + .4, 0)], + }), + stroke: width === 0 ? undefined : new Stroke({ + width: width, + color: [151, 173, 23, 1], + }), + }); + }), + }, + mrr_appl_met: { + popoverTitle: 'Undersökningstillstånd, metaller och industrimineral \u2013 ansökt', + popover: [ + ['Namn', 'Name'], + ['Koncessionsmineral', 'Mineral'], + ['Sökande', 'Applicant'], + ['Area', 'Area'], + ['Ansökningsdatum', 'Application date'], + ['Diary nr', 'Diary nr', { classes: ['feature-attr-dnr'] }], + ['Kommun', 'Municipality'], + ['Län', 'County'], + ['Senast uppdaterad', 'Last updated'], + ], + style: [0, .1, .5, .5, 1, 1.5, 2, 2.5, 3, 3.5, 4, 5].map(function(width, z) { + return new Style({ + zIndex: 26, + fill: new Fill({ + color: [0, 0, 0, Math.max((.2-.4)/4 * z + .4, 0)], + }), + stroke: width === 0 ? undefined : new Stroke({ + width: width, + color: [197, 14, 31, 1], + lineDash: width >= 1.5 ? [2 * width] : undefined, + }), + }); + }), + }, + mrr_appr_ogd: { + popoverTitle: 'Undersökningstillstånd, olja, gas och diamant \u2013 beviljad', + popover: [ + ['Namn', 'Name'], + ['Koncessionsmineral', 'Mineral'], + ['Ägare', 'Owner'], + ['Licence id', 'Licence id', { classes: ['feature-attr-mrr-license-id'] }], + ['Area', 'Area'], + ['Giltig från', 'Valid from'], + ['Giltig till', 'Valid to'], + ['Diary nr', 'Diary nr', { classes: ['feature-attr-dnr'] }], + ['Kommun', 'Municipality'], + ['Län', 'County'], + ['Senast uppdaterad', 'Last updated'], + ], + style: [0, .1, .5, .5, 1, 1.5, 2, 2.5, 3, 3.5, 4, 5].map(function(width, z) { + return new Style({ + zIndex: 24, + fill: new Fill({ + color: [30, 55, 87, Math.max((.2-.4)/4 * z + .4, 0)], + }), + stroke: width === 0 ? undefined : new Stroke({ + width: width, + color: [151, 173, 23, 1], + }), + }); + }), + }, + mrr_appl_ogd: { + popoverTitle: 'Undersökningstillstånd, olja, gas och diamant \u2013 ansökt', + popover: [ + ['Namn', 'Name'], + ['Koncessionsmineral', 'Mineral'], + ['Sökande', 'Applicant'], + ['Area', 'Area'], + ['Ansökningsdatum', 'Application date'], + ['Diary nr', 'Diary nr', { classes: ['feature-attr-dnr'] }], + ['Kommun', 'Municipality'], + ['Län', 'County'], + ['Senast uppdaterad', 'Last updated'], + ], + style: [0, .1, .5, .5, 1, 1.5, 2, 2.5, 3, 3.5, 4, 5].map(function(width, z) { + return new Style({ + zIndex: 26, + fill: new Fill({ + color: [30, 55, 87, Math.max((.2-.4)/4 * z + .4, 0)], + }), + stroke: width === 0 ? undefined : new Stroke({ + width: width, + color: [197, 14, 31, 1], + lineDash: width >= 1.5 ? [2 * width] : undefined, + }), + }); + }), + }, + mrr_appr_dl: { + popoverTitle: 'Markanvisning till koncession', + popover: [ + ['Namn', 'Name'], + ['Area', 'Area'], + ['Beslutsdatum', 'Decision date'], + ['Diary nr', 'Diary nr', { classes: ['feature-attr-dnr'] }], + ['Kommun', 'Municipality'], + ['Län', 'County'], + ['Senast uppdaterad', 'Last updated'], + ], + style: [0, .1, .5, .5, 1, 1.5, 2, 2.5, 3, 3.5, 4, 5].map(function(width, z) { + return new Style({ + zIndex: 20, + fill: new Fill({ + color: [228, 53, 45, Math.max((.2-1)/6 * z + 1, 0)], + }), + stroke: width === 0 ? undefined : new Stroke({ + width: width, + color: [151, 173, 23, 1], + }), + }); + }), + }, + mrr_appr_pc: { + popoverTitle: 'Gällande torvkoncession', + popover: [ + ['Namn', 'Name'], + ['Koncessionsmineral', 'Mineral'], + ['Ägare', 'Owner'], + ['Area', 'Area'], + ['Giltig från', 'Valid from'], + ['Giltig till', 'Valid to'], + ['Diary nr', 'Diary nr', { classes: ['feature-attr-dnr'] }], + ['Kommun', 'Municipality'], + ['Län', 'County'], + ['Senast uppdaterad', 'Last updated'], + ], + style: [0, .1, .5, .5, 1, 1.5, 2, 2.5, 3, 3.5, 4, 5].map(function(width, z) { + return new Style({ + zIndex: 21, + fill: new Fill({ + color: [65, 40, 27, Math.max((.2-1)/8 * z + 1, 0)], + }), + stroke: width === 0 ? undefined : new Stroke({ + width: width, + color: [151, 173, 23, 1], + }), + }); + }), + }, svk_lines: { popoverTitle: 'Kraftledning (befintlig)', popover: [ @@ -510,7 +725,7 @@ const layers = { ], style: [1, 1.5, 2, 2, 2, 2, 3, 4, 5, 6, 8, 10].map(function(width) { return new Style({ - zIndex: 2, + zIndex: 52, stroke: new Stroke({ color: 'black', width: width, @@ -522,7 +737,7 @@ const layers = { style: [undefined, undefined, undefined, undefined, undefined] .concat([3, 4, 5, 6, 8, 10, 15].map(function(radius) { return new Style({ - zIndex: 1, + zIndex: 51, image: new CircleStyle({ radius: radius, fill: new Fill({ @@ -561,7 +776,7 @@ const layers = { svk_stations: { style: [3, 4, 5, 6, 7, 8.5, 10].map(function(radius) { return new Style({ - zIndex: 0, + zIndex: 50, image: new RegularShape({ radius: radius, points: 4, @@ -605,6 +820,58 @@ const layerHierarchy = [ }, ], }, + { + text: 'Mineralrättigheter', + children: [ + { + text: 'Bearbetningskoncessioner', + children: [ + { + text: 'Beviljad', + layer: 'mrr_appr_ec', + }, + { + text: 'Ansökt', + layer: 'mrr_appl_ec', + }, + ], + }, + { + text: 'Undersökningstillstånd, olja, gas och diamant', + children: [ + { + text: 'Beviljad', + layer: 'mrr_appr_ogd', + }, + { + text: 'Ansökt', + layer: 'mrr_appl_ogd', + }, + ], + }, + { + text: 'Undersökningstillstånd, metaller och industrimineral', + children: [ + { + text: 'Beviljad', + layer: 'mrr_appr_met', + }, + { + text: 'Ansökt', + layer: 'mrr_appl_met', + }, + ], + }, + { + text: 'Markanvisningar till koncession', + layer: 'mrr_appr_dl', + }, + { + text: 'Gällande torvkoncessioner', + layer: 'mrr_appr_pc', + }, + ], + }, ]; const vectorSource = new VectorTile({ @@ -780,7 +1047,8 @@ map.addLayer(vectorLayer); item.appendChild(collapse); collapse.id = 'accordion-collapse-' + idx; collapse.classList.add('accordion-collapse', 'collapse'); - // collapse.setAttribute('data-bs-parent', '#' + accordion.id); + /* never expand more than accordion at a time */ + collapse.setAttribute('data-bs-parent', '#' + accordion.id); btn.type = 'button'; btn.setAttribute('data-bs-toggle', 'collapse'); |