Closed javanese84 closed 5 months ago
Now, it works without any issue. That's my code:
const markerArray = L.markerClusterGroup();
for (const loc of this.locations) {
passArray.addLayer(marker([ loc.lat, loc.lon ], {
icon: this.icon
}));
}
this.markerGroup = markerArray;
in my template:
<div style="height: 500px;"
leaflet
(leafletMapReady)="onMapReady($event)"
[leafletOptions]="options">
@if (markerGroup) {
<div [leafletLayer]="markerGroup"></div>
}
</div>
Hi,
I just tried implementing the markerCluster functionality into my application based on Angular17 (with standalone Components). I copied the example from this repo 1:1 (as own module as in the example) and getting the following error: TypeError: L.markerClusterGroup is not a function
The Error is thrown within the directive in the ngOnInit (line 18). See the following screenshot.
Extract from package.json:
"leaflet": "^1.9.4", "leaflet.markercluster": "^1.5.3", "@asymmetrik/ngx-leaflet": "^17.0.0", "@asymmetrik/ngx-leaflet-markercluster": "^17.0.0",