added tree and fire icon

This commit is contained in:
Anton 2023-12-20 20:36:57 +01:00
parent 5b979ef411
commit 0e63c794d3
2 changed files with 49 additions and 32 deletions

View File

@ -51,6 +51,20 @@
width: 13px;
}
.fire-icon {
position: relative;
top: -36px;
left: 10px;
width: 13px;
}
.tree-icon {
position: relative;
top: -38px;
left: 4px;
width: 24px;
}
.leaflet-popup-scrolled {
overflow-x: hidden;
}

View File

@ -20,13 +20,16 @@ const addIcon = (icon:string) => {
break;
case "user":
return '<svg fill="#fff" class="user-icon" xmlns="http://www.w3.org/2000/svg" height="1.5em" viewBox="0 0 448 512"><!--! Font Awesome Free 6.4.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --><path d="M224 256A128 128 0 1 0 224 0a128 128 0 1 0 0 256zm-45.7 48C79.8 304 0 383.8 0 482.3C0 498.7 13.3 512 29.7 512H418.3c16.4 0 29.7-13.3 29.7-29.7C448 383.8 368.2 304 269.7 304H178.3z"/></svg>'
case "fire":
return '<svg fill="#fff" class="fire-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 19.534 26.387"><path d="M7.15 26.05C2.894 24.876.006 21.028.006 16.53c0-4.036 2.718-8.378 4.38-6.999.289.24.383.993.383 3.074 0 3.3.46 4.508 1.997 5.237 2.512 1.192 5.206-1.18 4.506-3.969-.097-.386-.99-1.562-1.986-2.614C7.04 8.887 6.583 8.026 6.583 6.176c0-2.333 2.02-6.182 3.244-6.182.59 0 1.292.98 1.292 1.805 0 1.227.951 2.596 3.727 5.362 3.655 3.642 4.493 5.216 4.671 8.776.143 2.847-.365 4.593-1.93 6.644-2.332 3.054-6.69 4.503-10.437 3.47z"/></svg>'
case "tree":
return '<svg svg fill="#fff" class="tree-icon" xmlns="http://www.w3.org/2000/svg" height="2em" xml:space="preserve" viewBox="0 0 24 24"><path d="M11 21v-4.3c-.5.2-1 .3-1.5.3C7 17 5 15 5 12.5c0-1.3.5-2.4 1.4-3.2-.3-.6-.4-1.2-.4-1.8C6 5 8 3 10.5 3c1.6 0 2.9.8 3.8 2h.2c3 0 5.5 2.5 5.5 5.5S17.5 16 14.5 16c-.5 0-1-.1-1.5-.2V21h-2z"/><path fill="none" d="M0 0h24v24H0z"/></svg>'
default:
return "";
}
}
const MarkerIconFactory = (shape:string, color1:string, color2:string, icon:string) =>
{
const MarkerIconFactory = (shape: string, color1: string, color2: string, icon: string) => {
return L.divIcon({
html: `${createSvg(shape, color1, color2)}${addIcon(icon)}`,
iconAnchor: [17, 40],