From edeea119199084b92eaa8b3fd5c3658ca1e9bb6c Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Tue, 11 Dec 2012 17:16:39 +0200 Subject: [PATCH] fix GeoJSON resetStyle not fully resetting, close #1112 --- src/layer/GeoJSON.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/layer/GeoJSON.js b/src/layer/GeoJSON.js index 79a7e558..ac697d0e 100644 --- a/src/layer/GeoJSON.js +++ b/src/layer/GeoJSON.js @@ -1,4 +1,9 @@ +/* + * L.GeoJSON turns any GeoJSON data into a Leaflet layer. + */ + L.GeoJSON = L.FeatureGroup.extend({ + initialize: function (geojson, options) { L.setOptions(this, options); @@ -39,6 +44,9 @@ L.GeoJSON = L.FeatureGroup.extend({ resetStyle: function (layer) { var style = this.options.style; if (style) { + // reset any custom styles + delete layer.options; + this._setLayerStyle(layer, style); } },