-
-
Notifications
You must be signed in to change notification settings - Fork 6k
Closed
Description
If you run setStyle on a layer to change a style away from one you didn't set, so it was just the default, like
var myLayer = L.geoJson('',{style:function(){return {dashArray:"5, 10"}}}).addTo(map);
var myLines = [{
"type": "LineString",
"coordinates": [[-100, 40], [-105, 45], [-110, 55]]
}, {
"type": "LineString",
"coordinates": [[-105, 40], [-110, 45], [-115, 55]]
}];
myLayer.addData(myLines);
myLayer.setStyle({color:"red",dashArray:null});then running reset style on it
myLayer.eachLayer(function(l){myLayer.resetStyle(l);});only changes back the styles to ones that you set not ones that were changed away form the default, i.e. dashArray is changed back but not color