Closed nickolas1 closed 9 years ago
@tombatossals I will check this when I have a little time.
Plnkr seems to be down. Anyways it seems to working better with the latest. use
<script src="http://cdn.rawgit.com/tombatossals/angular-leaflet-directive/master/dist/angular-leaflet-directive.js"></script>
In your dependencies.
Did you trying debugging the code?
it does work better with the latest master, but I still see issues relating to markers that are initially part of a cluster. see comments on #666 which I think are the root issue now.
@jessertaylor ?
problem is really here https://github.com/tombatossals/angular-leaflet-directive/blob/master/src/services/leafletMarkersHelpers.js#L164
When
$compile(marker.label._container)(labelScope);
Is hit, if it is a cluster _container is undefined. i think _container is only defined when it is visible (ie not a cluster). In reality we should be setting content via setContent after post compile. The when the clusterer makes it visible the _container is made correctly under the hood. This is why you should use accessors and not use private members.
My attempt to fix it is not working.
I am wondering if we need to hook to https://github.com/Leaflet/Leaflet.markercluster event animationend and re-check the markers who's labels were not ready.
Got it working http://plnkr.co/edit/1oOLAEE2TJHA8AJzGAHs?p=preview
If you are using a template via ng-include in a label message, and the marker is part of a markercluster group, compilation of the message doesn't appear to work correctly.
I tried to make a plunker showing this but it seems that putting the example into plunker broke the label message compilation even for non-grouped markers: http://plnkr.co/edit/o7jb3pZwfNZeB0nVvZBq?p=preview
the equivalent grouping with plain messages instead of labels works fine: http://plnkr.co/edit/ZMWJKOC0oExQEQu64J9Q?p=preview