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'] = '
'+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);