Having trouble with Leaflet clusterGroup, encountering the following error: Leaflet error Uncaught (in promise) TypeError: layer.addEventParent is not a function
const markerClusters = new MarkerClusterGroup();
const clusters = [];
const markers = [];
const customIcon = new L.Icon({
iconUrl: "https://unpkg.com/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="ef838a8e89838a9bafdec1dac1de">[email protected]</a>/dist/images/marker-icon.png",
iconSize: [25, 41]
});
onMounted(()=>{
markerClusters.clearLayers();
toRaw(props.coordinatesTwo).forEach((item)=> {
let marker = L.marker(new L.LatLng(item.coordinates.lat, item.coordinates.lng), {
icon: customIcon
})
markers.push(marker)
//markerClusters.addLayer(marker);
})
markerClusters.addLayer(markers)
//console.log(markers);
props.map.leafletObject.addLayer(markerClusters);
})