[OpenLayers-Commits] r7488 - sandbox/vector-behavior/lib/OpenLayers/Strategy
commits at openlayers.org
commits at openlayers.org
Fri Jul 11 10:47:53 EDT 2008
Author: elemoine
Date: 2008-07-11 10:47:53 -0400 (Fri, 11 Jul 2008)
New Revision: 7488
Modified:
sandbox/vector-behavior/lib/OpenLayers/Strategy/Grid.js
Log:
tiles must remove their reference to feature being removed
Modified: sandbox/vector-behavior/lib/OpenLayers/Strategy/Grid.js
===================================================================
--- sandbox/vector-behavior/lib/OpenLayers/Strategy/Grid.js 2008-07-11 11:44:10 UTC (rev 7487)
+++ sandbox/vector-behavior/lib/OpenLayers/Strategy/Grid.js 2008-07-11 14:47:53 UTC (rev 7488)
@@ -68,11 +68,19 @@
initialize: function(options) {
this.features = [];
OpenLayers.Util.extend(this, options);
+ this.strategy.layer.events.on({
+ 'beforefeatureremoved': this.beforefeatureremoved,
+ scope: this
+ });
},
/**
*/
destroy: function() {
+ this.strategy.layer.events.un({
+ 'beforefeatureremoved': this.beforefeatureremoved,
+ scope: this
+ });
this.destroyFeatures();
this.bounds = null;
this.position = null;
@@ -82,6 +90,13 @@
/**
*/
+ beforefeatureremoved: function(obj) {
+ var feature = obj.feature;
+ OpenLayers.Util.removeItem(this.features, feature);
+ },
+
+ /**
+ */
destroyFeatures: function() {
if (this.features.length > 0) {
var toDestroy = null;
More information about the Commits
mailing list