fix GeoJSON resetStyle not fully resetting, close #1112

This commit is contained in:
Vladimir Agafonkin 2012-12-11 17:16:39 +02:00
parent df03016f0c
commit edeea11919

View File

@ -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);
} }
}, },