From bbb884c92466e4452618c126c5e6671c7568d919 Mon Sep 17 00:00:00 2001 From: Mladen Gibanica <11275336+mgcth@users.noreply.github.com> Date: Tue, 30 Jan 2024 19:15:35 +0100 Subject: [PATCH] Increase font size of text and remove data layer duplication --- src/App.tsx | 31 ++++++++++++++++++++++++++++--- src/Header.tsx | 4 ++-- 2 files changed, 30 insertions(+), 5 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index 961ab08..0a6fa2a 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -128,12 +128,37 @@ export function App() { pointType: "text", // @ts-ignore getText: (f) => f.properties.textstrang, - getTextSize: 12, + getTextSize: (f: any) => { + switch (f.properties.textstorleksklass) { + case "10": + return 14; + case "9": + return 14; + case "8": + return 14; + case "7": + return 14; + case "6": + return 12; + case "5": + return 12; + case "4": + return 12; + case "3": + return 10; + case "2": + return 10; + case "1": + return 10; + default: + return 10; + } + }, textCharacterSet: "auto", textFontFamily: "Helvetica", getTextColor: [0, 0, 0], - textOutlineColor: [255, 255, 255, 200], - textOutlineWidth: 10, + textOutlineColor: [255, 255, 255, 255], + textOutlineWidth: 4, textFontSettings: { sdf: true }, }), ); diff --git a/src/Header.tsx b/src/Header.tsx index afab277..7c65906 100644 --- a/src/Header.tsx +++ b/src/Header.tsx @@ -243,12 +243,12 @@ export function Header() { - {communicationList} + {} - {communicationList} + {}