I'm using ngx-leaflet-markercluster in angular for showing cluster of markers sharing same location.While setting markers ,it gives error addeventparent is not a function .
//ts
const data: Marker[] = res.map(loc => {
if (loc.STATUS === this.appConstantsService.OUTAGE_STATUS.INACTIVE) {
return { lat: loc.location_details_lat, lon: loc.location_details_lon, icon: '/assets/icons/marker-0.png' };
} else {
return { lat: loc.location_details_lat, lon: loc.location_details_lon, icon: 'assets/icons/marker-1.png' };
}
});
this.markerClusterData = data;
//html
<div leaflet style="height: 600px;"
[leafletOptions]="options"
[leafletBaseLayers]="baseLayers"
[leafletMarkerCluster]="markerClusterData"
[leafletMarkerClusterOptions]="markerClusterOptions"
(leafletMarkerClusterReady)="markerClusterReady($event)"
>
</div>
I want markers to appear in cluster when it have same lat and long ,and when I click the cluster it should zoom in and show the markers.First I was working with agm map.I got an issue when two markers share same lat and long .I used agm-marker-cluster and agm-maker-spider but there was no solution in it.Is there any other way to solve it