Skip to content
Browse files

Move this._layer initialization to _initialDraw

This fixes a bug where, when the location filter was added,
removed, and re-added to a map, it would not display. This
happened because the re-add would reinitialize this._layer
but not call _initialDraw, which sets up this._layer.
  • Loading branch information...
1 parent 94c74da commit 2ece0c3df5b34ca646bf8877db517dbb18d318ce @jfirebaugh jfirebaugh committed Oct 8, 2013
Showing with 2 additions and 1 deletion.
  1. +2 −1 src/locationfilter.js
View
3 src/locationfilter.js
@@ -114,7 +114,6 @@ L.LocationFilter = L.Class.extend({
onAdd: function(map) {
this._map = map;
- this._layer = new L.LayerGroup();
if (this.options.enableButton || this.options.adjustButton) {
this._initializeButtonContainer();
@@ -285,6 +284,8 @@ L.LocationFilter = L.Class.extend({
return;
}
+ this._layer = new L.LayerGroup();
+
// Calculate filter bounds
this._calculateBounds();

0 comments on commit 2ece0c3

Please sign in to comment.
Something went wrong with that request. Please try again.