move getFeature() to the Layer
git-svn-id: http://svn.openlayers.org/trunk/openlayers@995 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -180,6 +180,43 @@ OpenLayers.Layer.WFS.prototype =
|
|||||||
return OpenLayers.Layer.Grid.prototype.getFullRequestString.apply(
|
return OpenLayers.Layer.Grid.prototype.getFullRequestString.apply(
|
||||||
this, arguments);
|
this, arguments);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {String} featureID
|
||||||
|
*
|
||||||
|
* @returns The Feature, found within one of the layer's tiles' features
|
||||||
|
* array, with a matching id.
|
||||||
|
* If none found or if null passed-in, returns null
|
||||||
|
* @type OpenLayers.Feature
|
||||||
|
*/
|
||||||
|
getFeature: function(featureID) {
|
||||||
|
var foundFeature = null;
|
||||||
|
if (featureID != null) {
|
||||||
|
|
||||||
|
if (this.grid) {
|
||||||
|
|
||||||
|
for(var iRow = 0; iRow < this.grid.length; iRow++) {
|
||||||
|
var row = this.grid[iRow];
|
||||||
|
for(var iCol = 0; iCol < row.length; iCol++) {
|
||||||
|
var tile = row[iCol];
|
||||||
|
|
||||||
|
for(var i=0; i < tile.features.length; i++) {
|
||||||
|
var feature = tile.features[i];
|
||||||
|
if (feature.id = featureID) {
|
||||||
|
foundFeature = feature;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
return foundFeature;
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/** @final @type String */
|
/** @final @type String */
|
||||||
CLASS_NAME: "OpenLayers.Layer.WFS"
|
CLASS_NAME: "OpenLayers.Layer.WFS"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -107,22 +107,6 @@ OpenLayers.Tile.WFS.prototype =
|
|||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
|
||||||
* @param {String} featureID
|
|
||||||
*/
|
|
||||||
getFeature: function(featureID) {
|
|
||||||
var foundFeature = null;
|
|
||||||
if (featureID != null) {
|
|
||||||
for(var i=0; i < this.features.length; i++) {
|
|
||||||
var feature = this.features[i];
|
|
||||||
if (feature.id = featureID) {
|
|
||||||
foundFeature = feature;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return foundFeature;
|
|
||||||
},
|
|
||||||
|
|
||||||
/** @final @type String */
|
/** @final @type String */
|
||||||
CLASS_NAME: "OpenLayers.Tile.WFS"
|
CLASS_NAME: "OpenLayers.Tile.WFS"
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user