import * as L from 'leaflet';
const createSvg = (shape: string, markerColor: string, borderColor: string) => {
const svgMap = {
circle: '',
square: '',
star: '',
penta: ''
};
return svgMap[shape];
}
const addIcon = (icon: string) => {
switch (icon) {
case "point":
return '';
break;
case "calendar":
return '';
break;
case "user":
return ''
case "fire":
return ''
case "tree":
return ''
case "music":
return ''
case "drum":
return ''
case "quest":
return ''
case "compass":
return ''
case "liebevoll.jetzt":
return ''
case "group":
return ''
case "puzzle":
return ''
default:
return "";
}
}
const MarkerIconFactory = (shape: string, color1: string, color2: string, icon: string) => {
return L.divIcon({
html: `${createSvg(shape, color1, color2)}${addIcon(icon)}`,
iconAnchor: [17, 40],
popupAnchor: [0, -40],
iconSize: new L.Point(40, 46),
className: "leaflet-data-marker",
shadowAnchor: [0, 0]
});
}
export default MarkerIconFactory;