From c0fbf1f58cd74c1f40020672b0cab1289c970c7a Mon Sep 17 00:00:00 2001 From: KoalaGeo Date: Thu, 28 Sep 2023 22:52:31 +0100 Subject: [PATCH] all grey --- radon/radon.html | 67 ++++++------------------------------------------ 1 file changed, 8 insertions(+), 59 deletions(-) diff --git a/radon/radon.html b/radon/radon.html index 2fcde66..8a9fa8b 100644 --- a/radon/radon.html +++ b/radon/radon.html @@ -21,67 +21,16 @@ url: "radon.pmtiles", attributions: ["© Land Information New Zealand"] }), - style: function(feature) { - // Get the Class_Max attribute value from the feature - const classMax = feature.get("CLASS_MAX"); - - // Define styles for different attribute values - let style; - if (classMax === 1) { - style = new ol.style.Style({ - stroke: new ol.style.Stroke({ - color: 'red', - width: 1, - }), - fill: new ol.style.Fill({ - color: 'rgba(255, 0, 0, 0.9)', - }) - }); - } else if (classMax === 2) { - style = new ol.style.Style({ - stroke: new ol.style.Stroke({ - color: 'red', - width: 1, - }), - fill: new ol.style.Fill({ - color: 'rgba(255, 0, 0, 0.9)', - }) - }); - } else if (classMax === 3) { - style = new ol.style.Style({ - stroke: new ol.style.Stroke({ - color: 'red', - width: 1, - }), - fill: new ol.style.Fill({ - color: 'rgba(255, 0, 0, 0.9)', - }) - }); - } else if (classMax === 4) { - style = new ol.style.Style({ - stroke: new ol.style.Stroke({ - color: 'red', + style: new ol.style.Style({ + stroke: new ol.style.Stroke({ + color: 'gray', width: 1, - }), - fill: new ol.style.Fill({ - color: 'rgba(255, 0, 0, 0.9)', - }) - }); - } else if (classMax === 5) { - style = new ol.style.Style({ - stroke: new ol.style.Stroke({ - color: 'red', - width: 1, - }), - fill: new ol.style.Fill({ - color: 'rgba(255, 0, 0, 0.9)', + }), + fill: new ol.style.Fill({ + color: 'rgba(20,20,20,0.9)', + }) }) - }); - } - - return style; - } - }); + }); ol.proj.useGeographic(); const map = new ol.Map({