-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problems for ClearLayers and addLayers method #99
Comments
Do you end up calling map.addLayers(markers) multiple times? That might cause some issues. Pretty certain I fixed all the issues with this, but there might be some left. |
Yes, ngos_markers and users_markers are layer groups. What's weird is that filter works just the first time and stops working for the next triggers. |
No news on this by chance? |
Could you make a jsfiddle that reproduces the issue? |
I've been trying to reproduce the issue, but leaflet seems to have problems working in the jsfiddle iframe http://jsfiddle.net/apuntovanini/FKdfK/4/ |
You missed the css file: Will take a look after lunch. |
Yep, clearLayers wasn't quite doing the right thing. Fixed! Check it out :) |
Confirmed: it does work like a charm! |
Hi!
I think there's an issue when trying to clear layers and add layers. Basically, I have a map in which i cluster 4 different layer groups. I set a little filter that hides and shows groups accordingly:
$(document).on("click", "#filters > li", function() {
markers.clearLayers();
switch ($(this).data('entity')) {
case 'Ngo':
markers.addLayer(ngos_markers);
break;
case 'User':
markers.addLayer(users_markers);
}
map.addLayer(markers);
});
The first time I click on the filters, markers do clear, and the new layer group is shown. When I try to do so second time, however, no markers are shown. I'm probably missing out something.
Can you help me out?
Thanks in advance!
Andrea
The text was updated successfully, but these errors were encountered: