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 added layer #61

Open
tmamedzadeh opened this issue Aug 29, 2018 · 1 comment
Open

Remove added layer #61

tmamedzadeh opened this issue Aug 29, 2018 · 1 comment

Comments

@tmamedzadeh
Copy link

Is there a way to remove the added layer, without removing other polygons and markers?

@johnd0e
Copy link

johnd0e commented Mar 26, 2019

Sure there is.
The easiest method is using Layers control.

  var layerswitcher = L.control.layers().addTo(map);
  var control = L.Control.fileLayerLoad().addTo(map);

  control.loader.on('data:loaded', function (e) {
    layerswitcher.addOverlay(e.layer, e.filename);
  });

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

2 participants