From df3039a04b1d27ee8f004729ab0847837d447ce9 Mon Sep 17 00:00:00 2001 From: Eric van der Vlist Date: Mon, 6 Mar 2023 21:16:19 +0100 Subject: [PATCH] Specific icon for notes --- src/components/gpx/styles.ts | 11 ++++++++++- src/icons/note-svgrepo-com.svg | 6 ++++++ 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 src/icons/note-svgrepo-com.svg diff --git a/src/components/gpx/styles.ts b/src/components/gpx/styles.ts index 0d45c6e..1c39c6b 100644 --- a/src/components/gpx/styles.ts +++ b/src/components/gpx/styles.ts @@ -13,6 +13,7 @@ import caveIcon from '../../icons/cave-entrance-svgrepo-com.svg'; import hikerIcon from '../../icons/hiker-svgrepo-com.svg'; import leftArrowIcon from '../../icons/right-arrow-svgrepo-com.svg'; import blackArrowheadPointingUp from '../../icons/black-arrowhead-pointing-up-svgrepo-com.svg'; +import noteIcon from '../../icons/note-svgrepo-com.svg'; import wptIconSel from '../../icons/location-pin-svgrepo-com-red.svg'; import { Feature } from 'ol'; import memoize from 'memoizee'; @@ -45,6 +46,12 @@ getAllPoiTypes().forEach((type) => { }); const icons = { + note: { + src: noteIcon, + scale: 1 / 20, + opacity: 0.9, + anchor: [0.5, 1], + }, house: { src: houseIcon, scale: 1 / 15, @@ -182,7 +189,9 @@ const styles = { return { isSelected: feature.get('isSelected') ?? false, text: feature.get('name'), - customIcon: icons[feature.get('sym') as keyof typeof icons], + customIcon: + icons[feature.get('sym') as keyof typeof icons] || + icons[feature.get('extensions')?.category as keyof typeof icons], hidden: minZoom && getZoominteger() < minZoom, }; }, diff --git a/src/icons/note-svgrepo-com.svg b/src/icons/note-svgrepo-com.svg new file mode 100644 index 0000000..54546b9 --- /dev/null +++ b/src/icons/note-svgrepo-com.svg @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file