Skip to content

Commit

Permalink
all grey
Browse files Browse the repository at this point in the history
  • Loading branch information
KoalaGeo committed Sep 28, 2023
1 parent 6387910 commit c0fbf1f
Showing 1 changed file with 8 additions and 59 deletions.
67 changes: 8 additions & 59 deletions radon/radon.html
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down

0 comments on commit c0fbf1f

Please sign in to comment.