From 4cb5f6ac67fad8db20bcbb348c9121bef93977ee Mon Sep 17 00:00:00 2001 From: Compufreak345 Date: Fri, 31 Jul 2015 20:34:10 +0200 Subject: [PATCH 1/3] Add options-property to geojson-element Providing an easy way to pass an options-object for initialising the GeoJson-element. --- leaflet-geojson.html | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/leaflet-geojson.html b/leaflet-geojson.html index b9607c6..3785f7f 100644 --- a/leaflet-geojson.html +++ b/leaflet-geojson.html @@ -149,6 +149,16 @@ lineJoin: { type: String, value: null + }, + /** + * The attribute `options` sets the options that are passed additonally when the geoJson-Object is created. + * (See http://leafletjs.com/reference.html#geojson) + * @attribute options + * @type Object + */ + options : { + type : Object, + value : null } }, @@ -164,8 +174,7 @@ if (this.feature) { this.container.removeLayer(this.feature); } - this.feature = L.geoJson(this.data); - + this.feature = L.geoJson(this.data, this.options); this.feature.addTo(this.container) .setStyle({ color: this.color, From 656ac0a6142bc892e1ec4266147cbe5048ec862b Mon Sep 17 00:00:00 2001 From: Compufreak345 Date: Sat, 1 Aug 2015 10:24:36 +0200 Subject: [PATCH 2/3] Fix crash in Safari Might be better to reregister the mutationObserver at the right point, but until now I did not see any issues. --- leaflet-core.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/leaflet-core.html b/leaflet-core.html index 1785909..0afcfaf 100644 --- a/leaflet-core.html +++ b/leaflet-core.html @@ -723,7 +723,8 @@ }, detached: function() { - this._mutationObserver.disconnect(); + if(this._mutationObserver) + this._mutationObserver.disconnect(); }, _viewChanged: function(newValue, oldValue) { From 2cfaa7d40b40ef267ebf3acd29c1be71ea52d452 Mon Sep 17 00:00:00 2001 From: Compufreak345 Date: Sat, 1 Aug 2015 10:25:30 +0200 Subject: [PATCH 3/3] Re-init MutationObserver Fixes issues in Safari & Firefox when using dynamic content. --- leaflet-layer-group.html | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/leaflet-layer-group.html b/leaflet-layer-group.html index 98d8b5f..d81e602 100644 --- a/leaflet-layer-group.html +++ b/leaflet-layer-group.html @@ -5,9 +5,9 @@ ##### Example - - - + + + @element leaflet-layer-group @@ -17,7 +17,7 @@ --> -