From efbb541fe91a51a5345730bd873155c187e576f2 Mon Sep 17 00:00:00 2001 From: mourner Date: Fri, 24 Sep 2010 15:49:27 +0300 Subject: [PATCH] make layer.draw & layer.load optional --- src/map/Map.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/map/Map.js b/src/map/Map.js index 6b49d259..14cf4e32 100644 --- a/src/map/Map.js +++ b/src/map/Map.js @@ -263,8 +263,8 @@ L.Map = L.Class.extend({ this._layers.push(layer); layer.onAdd(this); - this.on('viewreset', layer.draw, layer); - this.on('viewload', layer.load, layer); + if (layer.draw) { this.on('viewreset', layer.draw, layer); } + if (layer.load) { this.on('viewload', layer.load, layer); } this._layersMaxZoom = Math.max(this._layersMaxZoom || 0, layer.options.maxZoom); this._layersMinZoom = Math.min(this._layersMinZoom || Infinity, layer.options.minZoom);