From 78964cf41757bcea3916089ea6d90ab8e8ae70fa Mon Sep 17 00:00:00 2001 From: euzuro Date: Wed, 7 Jun 2006 16:10:32 +0000 Subject: [PATCH] keep an array of the features we have created. this will allow us to later destroy() them when the time comes. git-svn-id: http://svn.openlayers.org/trunk/openlayers@542 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/Layer/Text.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/OpenLayers/Layer/Text.js b/lib/OpenLayers/Layer/Text.js index 17d45c13c3..10cea80075 100644 --- a/lib/OpenLayers/Layer/Text.js +++ b/lib/OpenLayers/Layer/Text.js @@ -11,6 +11,9 @@ OpenLayers.Layer.Text.prototype = * @type str */ location:null, + /** @type Array(OpenLayers.Feature) */ + features: null, + /** @type OpenLayers.Feature */ selectedFeature: null, @@ -23,10 +26,12 @@ OpenLayers.Layer.Text.prototype = initialize: function(name, location) { OpenLayers.Layer.Markers.prototype.initialize.apply(this, [name]); this.location = location; + this.features = new Array(); new Ajax.Request(location, { method: 'get', onComplete:this.parseData.bind(this) } ); }, - + + /** * @param {?} ajaxRequest */ @@ -103,6 +108,7 @@ OpenLayers.Layer.Text.prototype = data['popupContentHTML'] = '

'+title+'

'+description+'

'; } var feature = new OpenLayers.Feature(this, location, data); + this.features.append(feature); var marker = feature.createMarker(); marker.events.register('click', feature, this.markerClick); this.addMarker(marker);