Reputation: 31
i use angular and leaflet, for the cluster i use leaflet.markerCluster library but all method explain on github page give error function not found. I have include the script and the style in angular.json file, the library was installed with npm. Work only for basic use: create a marker and push in cluster with addLayer. But if i need spiderfy() invoked over L.markerCluster object i receive error function not exist. this is some code:
Creation
private markerCluster;
this.markerCluster = L.markerClusterGroup({
showCoverageOnHover: false
});
ADD TO MAP
this.map.addLayer(this.markerCluster);
add markers in a loop
var marker = this.createMarker(point);
this.markerCluster.addLayer(marker);
if i invoke goes error
this.markerCluster.spiderfy();
Upvotes: 1
Views: 878