From d47a5a7eb1a85bc63d39410195174f6c01f69316 Mon Sep 17 00:00:00 2001 From: evlist Date: Sat, 4 Feb 2023 21:33:34 +0100 Subject: [PATCH] Working again on styles. --- src/components/gpx/styles.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/gpx/styles.ts b/src/components/gpx/styles.ts index 5b9e3a2..e78b96f 100644 --- a/src/components/gpx/styles.ts +++ b/src/components/gpx/styles.ts @@ -468,9 +468,13 @@ const styles = { if (getZoomInteger() < 13 && !['iwn', 'nwn', 'lwn'].includes(network)) { return null; } + const name = + getZoomInteger() < 15 + ? feature.get('ref') + : feature.get('name') || feature.get('ref'); return { // isSelected: feature.get('isSelected') ?? false, - name: feature.get('name'), + name: !!name ? name : undefined, network, zoom: getZoomInteger() >= 12 @@ -492,6 +496,7 @@ const styles = { font: 'bold 14px "Open Sans", "Arial Unicode MS", "sans-serif"', placement: 'line', overflow: false, + maxAngle: Math.PI / 16, textBaseline: ['iwn', 'nwn'].includes(network) ? 'top' : 'bottom', padding: [2, 2, 2, 2], fill: new Fill({