-
Notifications
You must be signed in to change notification settings - Fork 229
Static labels do not play with leaflet.markercluster #35
Comments
Ive put up a jsfiddle: http://jsfiddle.net/67njh/2/ |
Unfortunately, listening when the clustering animation has ended and then calling showLabel() is not enough: if a cluster is outside of viewable area, then the label for the unclustered marker is not shown. |
I think the issue is that Leaflet.markerclusterer removes markers from the map that are outside a bounds. My initial thought was to listen for However adding the code, didn't seem to work. map.on('layeradd', function(e) {
if (e.layer instanceof L.Marker && e.layer._labelNoHide) {
e.layer.showLabel();
}
}); I'll have a chat to @danzel tomorrow. He should be able to give me better insight into how Leaflet.markercluster works in this case. |
Hi. I solved for me by listening to moveend on the map and on animationend on the markerclustergroup and showing the label of every marker. This however will not scale for many markers... Best regards. Jacob Toye notifications@github.com wrote:
|
It would be nice if you could call show before the marker was on the map and never have to worry about it again. |
Hi, there are a solution for this? I need it for my mobile app, and I have approximately 200 markers, so I can't use the above method for efficiency. Thanks! |
Yeah I'll take a look today :) |
Hi, thank you for the commit :) But I have just test it and isn't work on mobile browsers. When I expand a cluster with markers with labels, the markers out of the screen doesn't display the label, although I drag the screen, only with zoomIn the label is displayed. On desktop browsers works perfectly, but on iOs and Android no. Thanks! |
I get this still too on iPad etc.. |
The issue also appears in JavaFX app where I am displaying a map. Labels are not rendered outside visible bounds. I managed to resolve issue by setting removeOutsideVisibleBounds: false. |
Hi,
first of all thanks for the plugin, in particular for static labels and the ability to have several labels display at the same time.
However, when using your plugin together with markercluster, static labels do not show up again when a marker is unclustered. Furthermore, once the zoom level changes, a static label of a marker, that was unclustered before and is still unclustered, disappears.
Best regards,
ugh-bough
The text was updated successfully, but these errors were encountered: