javascript - Cannot remove LayerGroup or FeatureGroup in Leaflet -


i'm using leaflet javascript. have lot of layers being added l.featuregroup (i have tried adding them l.layergroup). problem is, when call either of following functions, not clear layers off map:

map.clearlayers(layergroup); map.removelayer(layergroup); 

i have set this:

var layersolutiongroup = new l.featuregroup(); //var layersolutiongroup = new l.layergroup(); have tried both of these          var test = l.tilelayer.wms("http://censored:8080/geoserver/ows?", {             layers: 'test:layer1',             format: 'image/png',             transparent: true,             name: 'yep',             cql_filter : customparamsls         }).addto(layergroup);          var test2 = l.tilelayer.wms("http://censored:8080/geoserver/ows?", {                             layers: 'test:layer2',             format: 'image/png',             transparent: true,             name: 'test1',             cql_filter : customparamsls             }).addto(layergroup); 

i have delete button that, among other things, calls functions:

map.clearlayers(layergroup); map.removelayer(layergroup); 

the button works fine clears other things off map, not clear layergroup off map.

is there more work??


Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -