Testing missing icons

This commit is contained in:
Eric van der Vlist 2023-01-24 10:54:36 +01:00
parent 10a5f2fb18
commit 2081093ea4
2 changed files with 17 additions and 1 deletions

View File

@ -25,6 +25,7 @@ import { indexOf } from 'lodash';
import { getZoomInteger } from '../map/Map'; import { getZoomInteger } from '../map/Map';
import { isHighlighted } from '../map-tile-provider'; import { isHighlighted } from '../map-tile-provider';
import { import {
getAllPoiTypes,
getHighlightedTagValue, getHighlightedTagValue,
getTagValue, getTagValue,
} from '../map-tile-provider/MapTileProvider'; } from '../map-tile-provider/MapTileProvider';
@ -35,6 +36,12 @@ interface StyleParameters {
isSelected: boolean; isSelected: boolean;
} }
getAllPoiTypes().forEach((type) => {
if (!Object.keys(osmIcons).includes(type)) {
console.warn({ caller: 'styles', message: 'missing icon', type });
}
});
const icons = { const icons = {
house: { house: {
src: houseIcon, src: houseIcon,
@ -178,7 +185,7 @@ const styles = {
}; };
}, },
getStyle: memoize((params: any) => { getStyle: memoize((params: any) => {
console.log({ caller: 'getStyle', params }); // console.log({ caller: 'getStyle', params });
const { isSelected, text, customIcon, hidden } = params; const { isSelected, text, customIcon, hidden } = params;
if (hidden) { if (hidden) {
return null; return null;

View File

@ -212,6 +212,15 @@ const currentOverlayHighlightedKey = () =>
export const currentOverlayHighlightedDefinition = () => export const currentOverlayHighlightedDefinition = () =>
currentCategory()[currentOverlayHighlightedKey()]; currentCategory()[currentOverlayHighlightedKey()];
export const getAllPoiTypes = () => {
let result = new Set();
Object.keys(overlayDefinitions).forEach((tagName) => {
const tag = overlayDefinitions[tagName];
result = new Set([...result, ...Object.keys(tag)]);
});
return [...result];
};
export const highlightedTags = () => { export const highlightedTags = () => {
let result = {}; let result = {};
Object.keys(overlayDefinitions).forEach((tagName) => { Object.keys(overlayDefinitions).forEach((tagName) => {