From f938a9389daa03479280e8a863b616af0f9d46c4 Mon Sep 17 00:00:00 2001 From: Ian Jones <51156018+ianjon3s@users.noreply.github.com> Date: Wed, 23 Oct 2024 09:47:26 +0100 Subject: [PATCH] style: Improve legibility of dot labels (#507) --- src/components/my-map/drawing.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/components/my-map/drawing.ts b/src/components/my-map/drawing.ts index 59ef7c7..b3f3f1c 100644 --- a/src/components/my-map/drawing.ts +++ b/src/components/my-map/drawing.ts @@ -69,15 +69,11 @@ function getVertices(drawColor: string) { function styleFeatureLabels(drawType: DrawTypeEnum, feature: FeatureLike) { return new Text({ text: feature.get("label"), - font: "20px Source Sans Pro,sans-serif", + font: "bold 19px Source Sans Pro,sans-serif", placement: drawType === "Point" ? "line" : "point", // "point" placement is center point of polygon fill: new Fill({ color: "#000", }), - stroke: new Stroke({ - color: "#fff", - width: 4, - }), }); } @@ -93,8 +89,12 @@ function configureDrawingLayerStyle( case "Point": return new Style({ image: new Circle({ - radius: 12, - fill: new Fill({ color: drawColor }), + radius: hideDrawLabels ? 10 : 12, + fill: new Fill({ color: "#fff" }), + stroke: new Stroke({ + color: drawColor, + width: hideDrawLabels ? 6 : 2, + }), }), text: drawMany && !hideDrawLabels