aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--index.html4
-rw-r--r--main.js144
2 files changed, 148 insertions, 0 deletions
diff --git a/index.html b/index.html
index 70a849c..b240a44 100644
--- a/index.html
+++ b/index.html
@@ -33,6 +33,10 @@
<a href="https://www.energimyndigheten.se/fornybart/elproduktion/vindkraft/vindbrukskollen/" target="_blank">Länsstyrelserna och Energimyndigheten</a>,
CC0 (<a href="https://ext-geodatakatalog-forv.lansstyrelsen.se/GeodataKatalogen/codelist/metadata/anvandningsrestriktioner.xml#CC01.0" target="_blank">öppna data</a>).
</li>
+ <li><i>Rennäringen</i> skikt från
+ <a href="https://sametinget.se" target="_blank">Sametinget</a>,
+ CC-BY-4.0 (<a href="https://ext-geodatakatalog-forv.lansstyrelsen.se/GeodataKatalogen/codelist/metadata/anvandningsrestriktioner.xml#CCby4.0" target="_blank">öppna data</a>).
+ </li>
<li>Bakgrund kartor från
&copy; <a href="https://lantmateriet.se" target="_blank">Lantmäteriet</a>, CC0
(<a href="https://www.lantmateriet.se/sv/geodata/vara-produkter/oppna-data/#anchor-1" target="_blank">öppna data</a>).
diff --git a/main.js b/main.js
index b3463ac..c065815 100644
--- a/main.js
+++ b/main.js
@@ -1104,6 +1104,127 @@ const layers = {
});
}),
},
+
+ st_renbete: {
+ popoverTitle: 'Samebyarnas betesområde',
+ popover: [
+ ['Sameby', 'NAMN'],
+ ['Samebys typ', 'SAMEBY_TYP'],
+ ['Objekt-ID', 'OBJECTID', { classes: ['feature-objid'] }],
+ ['Sameby-ID', 'SAMEBY_ID', { classes: ['feature-objid'] }],
+ ['By-ID', 'BY_ID', { classes: ['feature-objid'] }],
+ ['Signatur', 'SIGNATUR'],
+ ['Aktualitet', 'AKTUALITET'],
+ ],
+ style: [1, 1.5, 2, 3, 3.5, 4, 5, 5, 6, 7, 8, 10].map(function(width, z) {
+ return new Style({
+ zIndex: 4,
+ fill: new Fill({
+ /* transparent fill so clicking the inside of the polygon triggers a popover */
+ /* XXX could also use a custom renderer but that doesn't seem to work */
+ color: [0, 0, 0, 0],
+ }),
+ stroke: width === 0 ? undefined : new Stroke({
+ width: width,
+ color: [179, 153, 102, 1],
+ }),
+ });
+ }),
+ },
+ st_flyttled: {
+ popoverTitle: 'Samebyarnas markanvändningsredovisning \u2013 flyttled',
+ popover: [
+ ['Sameby #1', 'SAMEBY1'],
+ ['Sameby #2', 'SAMEBY2'],
+ ['Sameby #3', 'SAMEBY3'],
+ ['Beskrivning', 'BESKRIVNIN'],
+ ['Årstid', 'ARSTID'],
+ ['Sameby #1 Nr', 'BYNR1', { classes: ['feature-objid'], fn: (v) => v === 0 ? '' : v }],
+ ['Sameby #2 Nr', 'BYNR2', { classes: ['feature-objid'], fn: (v) => v === 0 ? '' : v }],
+ ['Sameby #3 Nr', 'BYNR3', { classes: ['feature-objid'], fn: (v) => v === 0 ? '' : v }],
+ ['Led-ID', 'LED_ID', { classes: ['feature-objid'], fn: (v) => v === 0 ? '' : v }],
+ ['Objekt-ID', 'OBJECTID', { classes: ['feature-objid'] }],
+ ['Riksintresse', 'RIKSINTR'],
+ ['Fast led', 'FAST_LED'],
+ ['Aktualitet', 'AKTUALITET'],
+ ['Signatur', 'SIGNATUR'],
+ ['Globalt ID', 'GlobalID', { classes: ['feature-objid'] }],
+ ],
+ style: [.75, 1, 1.5, 2, 3, 4, 5, 5, 6, 7, 8, 10].map(function(width, z) {
+ return new Style({
+ zIndex: 7,
+ stroke: new Stroke({
+ width: 2*width,
+ color: [119, 99, 59, 1],
+ lineDash: [4 * width],
+ }),
+ });
+ }),
+ },
+ st_riks_ren: {
+ popoverTitle: 'Riksintresse rennäring',
+ popover: [
+ ['Objekt-ID', 'OBJECTID', { classes: ['feature-objid'] }],
+ ['Lagrum', 'LAGRUM'],
+ ['Aktualitet', 'AKTUALITET'],
+ ['Signatur', 'SIGNATUR'],
+ ['Globalt ID', 'GlobalID', { classes: ['feature-objid'] }],
+ ],
+ style: [.5, 1, 1.5, 1.5, 2, 2, 2.5, 2.5, 3, 3.5, 4, 5].map(function(width, z) {
+ const patternCanvas = document.createElement('canvas');
+ const patternContext = patternCanvas.getContext('2d');
+ patternCanvas.width = z < 4 ? 4 : z <= 5 ? 8 : Math.pow(2, Math.round(Math.log2(width) + 3));
+ patternCanvas.height = patternCanvas.width;
+ patternContext.fillStyle = 'transparent';
+ patternContext.strokeStyle = 'rgba(179, 153, 102, 1)';
+ patternContext.lineWidth = Math.max(1, width/2);
+ patternContext.beginPath();
+ patternContext.moveTo(0, 0);
+ patternContext.lineTo(patternCanvas.width, 0);
+ patternContext.stroke();
+
+ const canvas = document.createElement('canvas');
+ const context = canvas.getContext('2d');
+ return new Style({
+ zIndex: 6,
+ fill: new Fill({
+ color: context.createPattern(patternCanvas, 'repeat'),
+ }),
+ stroke: width === 0 ? undefined : new Stroke({
+ width: width,
+ color: [179, 153, 102, 1],
+ }),
+ });
+ }),
+ },
+ st_riks_ren_core: {
+ popoverTitle: '(Kärn)områden av riksintresse rennäring',
+ popover: [
+ ['Objekt-ID', 'OBJECTID', { classes: ['feature-objid'] }],
+ ['Områdes-ID', 'OMR_NR', { classes: ['feature-objid'] }],
+ ['Länk', 'LANK'],
+ ['Årets runt', 'ARET_RUNT'],
+ ['Sameby', 'SAMEBY'],
+ ['Ansvarig', 'ANSVARIG'],
+ ['Aktualitet', 'AKTUALITET'],
+ ['Signatur', 'SIGNATUR'],
+ ['Globalt ID', 'GlobalID', { classes: ['feature-objid'] }],
+ ['Area', 'AREA_HA', { unit: 'ha' }],
+ ['Länskod', 'LANSKOD'],
+ ],
+ style: [.5, .5, 1, 1, 1, 1.5, 1.5, 1.5, 2, 2, 2, 2].map(function(width, z) {
+ return new Style({
+ zIndex: 5,
+ fill: new Fill({
+ color: [203, 190, 163, Math.max((.3-.5)/8 * z + .5, 0)],
+ }),
+ stroke: width === 0 ? undefined : new Stroke({
+ width: width,
+ color: [179, 153, 102, 1],
+ }),
+ });
+ }),
+ },
};
const layerHierarchy = [
@@ -1227,6 +1348,29 @@ const layerHierarchy = [
},
]
},
+ {
+ /* Definitions at
+ * https://ext-dokument.lansstyrelsen.se/Gemensamt/Geodata/Datadistribution/Information,%20Skiktf%C3%B6rteckning%20och%20f%C3%B6rklaringar.pdf */
+ text: 'Rennäringen',
+ children: [
+ {
+ text: 'Betesområden',
+ layer: 'st_renbete',
+ },
+ {
+ text: 'Flyttled',
+ layer: 'st_flyttled',
+ },
+ {
+ text: 'Riksintressen',
+ layer: 'st_riks_ren',
+ },
+ {
+ text: '(Kärn)områden av riksintresse',
+ layer: 'st_riks_ren_core',
+ },
+ ]
+ }
];
const vectorSource = new VectorTile({