tyles (again)

This commit is contained in:
Eric van der Vlist 2023-02-04 18:55:23 +01:00
parent 38a6230565
commit ad6feb6f15
1 changed files with 51 additions and 2 deletions

View File

@ -271,6 +271,49 @@ const styles = {
}, },
way: { way: {
strokes: { strokes: {
veryLowZoom: {
iwn: [
new Style({
stroke: new Stroke({
color: [255, 0, 0, 1],
width: 1,
}),
}),
],
nwn: [
new Style({
stroke: new Stroke({
color: [255, 0, 0, 1],
width: 1,
}),
}),
],
rwn: [
new Style({
stroke: new Stroke({
color: [255, 128, 0, 1],
width: 1,
}),
}),
],
lwn: [
new Style({
stroke: new Stroke({
color: [255, 255, 0, 1],
width: 1,
}),
}),
],
default: [
new Style({
stroke: new Stroke({
color: [255, 255, 0, 1],
width: 1,
lineDash: [10, 10],
}),
}),
],
},
lowZoom: { lowZoom: {
iwn: [ iwn: [
new Style({ new Style({
@ -301,6 +344,7 @@ const styles = {
stroke: new Stroke({ stroke: new Stroke({
color: [255, 255, 0, 0.6], color: [255, 255, 0, 0.6],
width: 3, width: 3,
lineDash: [10, 10],
}), }),
}), }),
], ],
@ -308,7 +352,7 @@ const styles = {
new Style({ new Style({
stroke: new Stroke({ stroke: new Stroke({
color: [255, 255, 0, 0.6], color: [255, 255, 0, 0.6],
width: 3, width: 1,
lineDash: [10, 10], lineDash: [10, 10],
}), }),
}), }),
@ -428,7 +472,12 @@ const styles = {
// isSelected: feature.get('isSelected') ?? false, // isSelected: feature.get('isSelected') ?? false,
name: feature.get('name'), name: feature.get('name'),
network, network,
zoom: getZoomInteger() >= 12 ? 'highZoom' : 'lowZoom', zoom:
getZoomInteger() >= 12
? 'highZoom'
: getZoomInteger() >= 8
? 'lowZoom'
: 'veryLowZoom',
}; };
}, },
getStyle: memoize((params: any) => { getStyle: memoize((params: any) => {