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

View File

@ -212,6 +212,15 @@ const currentOverlayHighlightedKey = () =>
export const currentOverlayHighlightedDefinition = () =>
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 = () => {
let result = {};
Object.keys(overlayDefinitions).forEach((tagName) => {