Muszę wczytać ikone zapisaną w formacie SVG. Mam metode która zwraca mi :
fillColor: ""
fillOpacity: 1
path: ""
scale:
strokeColor: ""
strokeWeight:
znalazłem przykład wczytania takiego formatu w leaflet niestety nie zadziałało, możliwe że źle odwołuje się do zmiennych
const url: any = (this.getMarkerIcon(marker))
const path: string = url.path
const fillColor = url.fillColor
const strokeColor = url.strokeColor
const fillOpacity = url.fillOpacity
const iconSettings = {
mapIconUrl: '<svg version="1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 149 178"><path fill="{fillColor}" stroke="{strokeColor} d="{path}"/></svg>',
};
let divIcon = L.divIcon({
className: "leaflet-data-marker",
html: L.Util.template(iconSettings.mapIconUrl, iconSettings).replace('#','%23'),
iconAnchor : [12, 32],
iconSize : [25, 30],
popupAnchor : [0, -28]
});