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

View File

@@ -238,14 +238,16 @@ OpenLayers.Layer.Grid.prototype = Object.extend( new OpenLayers.Layer(), {
* @private
*/
clearGrid:function() {
while(grid.length > 0) {
var row = grid[0];
while(row.length > 0) {
var tile = row[0];
tile.destroy();
row.remove(tile);
if (this.grid) {
while(this.grid.length > 0) {
var row = this.grid[0];
while(row.length > 0) {
var tile = row[0];
tile.destroy();
row.remove(tile);
}
this.grid.remove(row);
}
grid.remove(row);
}
}

View File

@@ -80,7 +80,7 @@ OpenLayers.Tile.WFS.prototype =
}
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");
//clear old featureList
@@ -88,21 +88,16 @@ OpenLayers.Tile.WFS.prototype =
for (var i=0; i < resultFeatures.length; i++) {
//create new Feature and add it
var newFeature = new ol.Feature(resultFeatures[i]);
//make new Feature
var feature = new ol.Feature(resultFeatures[i]);
//add new marker
var newMarker = this._createMarker(newFeature);
this._addMarker(newMarker);
//make new Icon
var icon = new OpenLayers.Icon(feature.markerImage, feature.size);
//save reference to the feature and marker
this.featureList[i] = new ol.Tile.WFS.FeatureItem(
newFeature, newMarker);
//make new marker
var marker = new OpenLayers.Marker(icon, feature.lonlat);
}
if (this.ds.markers != null) {
this.ds.markers.redraw();
}
},