From 6943424d34c0d01c23a6e6c801e4f004386fe3b2 Mon Sep 17 00:00:00 2001 From: Eric van der Vlist Date: Wed, 7 Jun 2023 10:23:02 +0200 Subject: [PATCH] Cleanup (removing getAllPoiTypes which was used only once) --- src/components/gpx/styles.ts | 16 ++-------------- .../map-tile-provider/MapTileProvider.tsx | 8 -------- 2 files changed, 2 insertions(+), 22 deletions(-) diff --git a/src/components/gpx/styles.ts b/src/components/gpx/styles.ts index 5facecf..4fe8e7b 100644 --- a/src/components/gpx/styles.ts +++ b/src/components/gpx/styles.ts @@ -1,6 +1,4 @@ import { Fill, Text, Icon, Stroke, Style, Circle } from 'ol/style'; -import startIcon from '../../icons/flag-start-b-svgrepo-com-green.svg'; -import finishIcon from '../../icons/flag-finish-b-o-svgrepo-com-red.svg'; import wptIcon from '../../icons/location-pin-svgrepo-com-green.svg'; import houseIcon from '../../icons/house-svgrepo-com.svg'; import houseFlatIcon from '../../icons/houseFlat-svgrepo-com.svg'; @@ -11,23 +9,18 @@ import trainIcon from '../../icons/train-svgrepo-com.svg'; import picnicIcon from '../../icons/picnic-svgrepo-com.svg'; 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'; -import { getMap, getState } from '../map'; +import { getMap } from '../map'; import { Point } from 'ol/geom'; import { Coordinate } from 'ol/coordinate'; import { createDefaultStyle } from 'ol/style/Style'; -import osmIcons, { highlight } from './osm-icons'; -import { indexOf } from 'lodash'; +import osmIcons from './osm-icons'; import { getZoomInteger } from '../map/Map'; -import { isHighlighted } from '../map-tile-provider'; import { - getAllPoiTypes, getHighlightedTagValue, getTagValue, } from '../map-tile-provider/MapTileProvider'; @@ -40,11 +33,6 @@ interface StyleParameters { isSelected: boolean; } -getAllPoiTypes().forEach((type) => { - if (!Object.keys(osmIcons).includes(type)) { - console.warn({ caller: 'styles', message: 'missing icon', type }); - } -}); const icons = { note: { diff --git a/src/components/map-tile-provider/MapTileProvider.tsx b/src/components/map-tile-provider/MapTileProvider.tsx index 9555905..08009b8 100644 --- a/src/components/map-tile-provider/MapTileProvider.tsx +++ b/src/components/map-tile-provider/MapTileProvider.tsx @@ -214,14 +214,6 @@ const currentOverlayHighlightedKey = () => export const currentOverlayHighlightedDefinition = () => currentCategory()[currentOverlayHighlightedKey()]; -export const getAllPoiTypes = () => { - let result = new Set(); - Object.keys(legacyOverlayDefinitions).forEach((tagName) => { - const tag = legacyOverlayDefinitions[tagName]; - result = new Set([...result, ...Object.keys(tag)]); - }); - return [...result]; -}; export const highlightedTags = () => { let result = {};