fixing bug introduced in [184]. just needed to be dereferencing grid (this.grid) and also to be making sure to only try to clean out when the grid has actually been initialized. SOMEBODY PUT THIS BOY IN A SANDBOX UNTIL HE CAN LEARN TO RUN THE DAMN TESTS BEFORE CHECKING IN.

git-svn-id: http://svn.openlayers.org/trunk/openlayers@186 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
euzuro
2006-05-19 17:37:10 +00:00
parent c59e66f167
commit 61d3c4412f
2 changed files with 16 additions and 19 deletions
+9 -7
View File
@@ -238,14 +238,16 @@ OpenLayers.Layer.Grid.prototype = Object.extend( new OpenLayers.Layer(), {
* @private * @private
*/ */
clearGrid:function() { clearGrid:function() {
while(grid.length > 0) { if (this.grid) {
var row = grid[0]; while(this.grid.length > 0) {
while(row.length > 0) { var row = this.grid[0];
var tile = row[0]; while(row.length > 0) {
tile.destroy(); var tile = row[0];
row.remove(tile); tile.destroy();
row.remove(tile);
}
this.grid.remove(row);
} }
grid.remove(row);
} }
} }
+7 -12
View File
@@ -80,7 +80,7 @@ OpenLayers.Tile.WFS.prototype =
} }
var resultFeatures = ol.Application.getNodes(doc, "gml:featureMember"); var resultFeatures = ol.Application.getNodes(doc, "gml:featureMember");
ol.Log.info(this.CLASS_NAME + " found " + ol.Log.info(this.grid.name + " found " +
resultFeatures.length + " features"); resultFeatures.length + " features");
//clear old featureList //clear old featureList
@@ -88,21 +88,16 @@ OpenLayers.Tile.WFS.prototype =
for (var i=0; i < resultFeatures.length; i++) { for (var i=0; i < resultFeatures.length; i++) {
//create new Feature and add it //make new Feature
var newFeature = new ol.Feature(resultFeatures[i]); var feature = new ol.Feature(resultFeatures[i]);
//add new marker //make new Icon
var newMarker = this._createMarker(newFeature); var icon = new OpenLayers.Icon(feature.markerImage, feature.size);
this._addMarker(newMarker);
//save reference to the feature and marker //make new marker
this.featureList[i] = new ol.Tile.WFS.FeatureItem( var marker = new OpenLayers.Marker(icon, feature.lonlat);
newFeature, newMarker);
} }
if (this.ds.markers != null) {
this.ds.markers.redraw();
}
}, },