Skip to content
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

Remove Doesn't Seem to work all of the time #25

Open
lisaWriteJava opened this issue Feb 9, 2018 · 6 comments
Open

Remove Doesn't Seem to work all of the time #25

lisaWriteJava opened this issue Feb 9, 2018 · 6 comments

Comments

@lisaWriteJava
Copy link

Hello,

I have a map with several layers that contain markers in each. When I remove a layer I'm trying to remove the edge marker for the markers that are no longer there. When I call .destroy, the markers don't go a way. The edge markers continue to point to makers that are no longer in the map. It works fine when I toggle all on and off but not for individual layers.

@ubergesundheit
Copy link
Owner

Hi,

can you please provide an example page where the error happens?

@lisaWriteJava
Copy link
Author

It's not so much an error as it doesn't seem to remove the edge marker

So in one case I monitor a change on the map like listenerService.listen('USER_SETTINGS_CHANGE'), function(settings){
if (settings.edgeMarkers){
edgeMarker.destroy();
}
});

but in the one where it's not working, Is below. No error is thrown it just doesnt do the removal. I have some similar code like
listenerService.listen('LAYER_REMOVED), function(){
edgeMarker.destroy();
});

edge markers is created above either of the listeners like this:
var edgeMarker;

listenerService.listen('RESULTS_PRESENT), function(results){
var resultsLayers = results.getLayers();
var myLayerGroup = L.layerGroup(resultsLayers );

edgeMarker = new L.EdgeMarker({
icon: myIcon,
layerGroup: myLayerGroup ,
title:'clickThest',
rotateIcons:true
}):

edgeMarker.addTo(map);

});

@lisaWriteJava
Copy link
Author

OH this is on an Intranet so I have no way to point you to a live example

@ubergesundheit
Copy link
Owner

Sorry, I need a working example to debug your issue.

@SLCPS
Copy link

SLCPS commented Aug 5, 2022

Your demo doesn't work either @ubergesundheit that makes it hard for us to help ourselves.

@ubergesundheit
Copy link
Owner

@SLCPS I fixed the demos, but I haven't done anything recently with the project and don't have time beyond fixing the demo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants