fix GeoJSON resetStyle not fully resetting, close #1112
This commit is contained in:
parent
df03016f0c
commit
edeea11919
@ -1,4 +1,9 @@
|
|||||||
|
/*
|
||||||
|
* L.GeoJSON turns any GeoJSON data into a Leaflet layer.
|
||||||
|
*/
|
||||||
|
|
||||||
L.GeoJSON = L.FeatureGroup.extend({
|
L.GeoJSON = L.FeatureGroup.extend({
|
||||||
|
|
||||||
initialize: function (geojson, options) {
|
initialize: function (geojson, options) {
|
||||||
L.setOptions(this, options);
|
L.setOptions(this, options);
|
||||||
|
|
||||||
@ -39,6 +44,9 @@ L.GeoJSON = L.FeatureGroup.extend({
|
|||||||
resetStyle: function (layer) {
|
resetStyle: function (layer) {
|
||||||
var style = this.options.style;
|
var style = this.options.style;
|
||||||
if (style) {
|
if (style) {
|
||||||
|
// reset any custom styles
|
||||||
|
delete layer.options;
|
||||||
|
|
||||||
this._setLayerStyle(layer, style);
|
this._setLayerStyle(layer, style);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user