From 2507e8113e46d583e7c17b0a66fc827613ced039 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Stefanini?= Date: Thu, 2 Oct 2014 18:22:16 +0300 Subject: [PATCH] Initialize map on add. As there is no guarantee the map as already been initialized, this is required. --- src/layer/FeatureGroup.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/layer/FeatureGroup.js b/src/layer/FeatureGroup.js index ee81ae8..9014586 100644 --- a/src/layer/FeatureGroup.js +++ b/src/layer/FeatureGroup.js @@ -10,8 +10,9 @@ R.FeatureGroup = L.FeatureGroup.extend({ }, onAdd: function(map) { - L.FeatureGroup.prototype.onAdd.call(this,map); - + L.FeatureGroup.prototype.onAdd.call(this, map); + this._map = map; + this._map._initRaphaelRoot(); this._set = this._map._paper.set(); for(i in this._layers) { @@ -34,4 +35,4 @@ R.FeatureGroup = L.FeatureGroup.extend({ return this; } -}); \ No newline at end of file +});