Testing missing icons
This commit is contained in:
1 parent
10a5f2fb18
commit
2081093ea4
2 files changed
+17
-1
No files matched your search
@@ -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;
|
||||||
|
|||||||
@@ -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) => {
|
||||||
|
|||||||
Reference in new issue
Block a user