From d7ab2c0f60b906ad8ff66743fda2cdf0bb2b6f3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Lemoine?= Date: Tue, 5 Aug 2008 13:59:12 +0000 Subject: [PATCH] Layer.Vector.removeMap must deactivate the strategies, r=fredj (closes #1649) git-svn-id: http://svn.openlayers.org/trunk/openlayers@7708 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/Layer/Vector.js | 39 +++++++++++++++++++++++++---- lib/OpenLayers/Protocol.js | 10 +++++++- lib/OpenLayers/Strategy.js | 42 ++++++++++++++++++++++++++++++++ lib/OpenLayers/Strategy/Fixed.js | 17 +++++++++---- tests/Protocol.html | 3 ++- tests/Strategy.html | 42 +++++++++++++++++++++++++++++++- 6 files changed, 140 insertions(+), 13 deletions(-) diff --git a/lib/OpenLayers/Layer/Vector.js b/lib/OpenLayers/Layer/Vector.js index 333a7a8d68..52fadd687a 100644 --- a/lib/OpenLayers/Layer/Vector.js +++ b/lib/OpenLayers/Layer/Vector.js @@ -229,13 +229,19 @@ OpenLayers.Layer.Vector = OpenLayers.Class(OpenLayers.Layer, { */ destroy: function() { if (this.strategies) { - for(var i=0, len=this.strategies.length; i} + */ + removeMap: function(map) { + if(this.strategies) { + var strategy, i, len; + for(i=0, len=this.strategies.length; i function test_initialize(t) { - t.plan(2); + t.plan(3); var options = {}; var protocol = new OpenLayers.Protocol(options); t.ok(protocol instanceof OpenLayers.Protocol, "new OpenLayers.Protocol returns object" ); t.eq(protocol.options, options, "constructor sets this.options"); + t.eq(protocol.autoDestroy, true, "constructor does not modify this.autoDestroy"); } function test_destroy(t) { diff --git a/tests/Strategy.html b/tests/Strategy.html index 4e16c3c30a..99521f6065 100644 --- a/tests/Strategy.html +++ b/tests/Strategy.html @@ -4,13 +4,16 @@