Working again on styles.

This commit is contained in:
Eric van der Vlist 2023-02-04 21:33:34 +01:00
parent aa158ab515
commit d47a5a7eb1
1 changed files with 6 additions and 1 deletions

View File

@ -468,9 +468,13 @@ const styles = {
if (getZoomInteger() < 13 && !['iwn', 'nwn', 'lwn'].includes(network)) { if (getZoomInteger() < 13 && !['iwn', 'nwn', 'lwn'].includes(network)) {
return null; return null;
} }
const name =
getZoomInteger() < 15
? feature.get('ref')
: feature.get('name') || feature.get('ref');
return { return {
// isSelected: feature.get('isSelected') ?? false, // isSelected: feature.get('isSelected') ?? false,
name: feature.get('name'), name: !!name ? name : undefined,
network, network,
zoom: zoom:
getZoomInteger() >= 12 getZoomInteger() >= 12
@ -492,6 +496,7 @@ const styles = {
font: 'bold 14px "Open Sans", "Arial Unicode MS", "sans-serif"', font: 'bold 14px "Open Sans", "Arial Unicode MS", "sans-serif"',
placement: 'line', placement: 'line',
overflow: false, overflow: false,
maxAngle: Math.PI / 16,
textBaseline: ['iwn', 'nwn'].includes(network) ? 'top' : 'bottom', textBaseline: ['iwn', 'nwn'].includes(network) ? 'top' : 'bottom',
padding: [2, 2, 2, 2], padding: [2, 2, 2, 2],
fill: new Fill({ fill: new Fill({