Merge vector-2.4 branch back to trunk.

svn merge sandbox/vector-2.4/@2307 sandbox/vector-2.4/@HEAD trunk/openlayers/


git-svn-id: http://svn.openlayers.org/trunk/openlayers@2803 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
crschmidt
2007-03-16 13:23:56 +00:00
parent 8b9d974dc2
commit 3ca974acec
159 changed files with 10193 additions and 343 deletions

View File

@@ -16,7 +16,7 @@ OpenLayers.Tile.WFS.prototype =
features: null,
/** @type Array(String) */
urls: null,
url: null,
/**
* @constructor
@@ -27,11 +27,11 @@ OpenLayers.Tile.WFS.prototype =
* @param {Array} urls
* @param {OpenLayers.Size} size
*/
initialize: function(layer, position, bounds, urls, size) {
initialize: function(layer, position, bounds, url, size) {
var newArguments = arguments;
newArguments = [layer, position, bounds, null, size];
OpenLayers.Tile.prototype.initialize.apply(this, newArguments);
this.urls = urls;
this.url = url;
this.features = new Array();
},
@@ -42,7 +42,7 @@ OpenLayers.Tile.WFS.prototype =
OpenLayers.Tile.prototype.destroy.apply(this, arguments);
this.destroyAllFeatures();
this.features = null;
this.urls = null;
this.url = null;
},
/** Clear the tile of any bounds/position-related data so that it can
@@ -57,12 +57,9 @@ OpenLayers.Tile.WFS.prototype =
*
*/
draw:function() {
if (!OpenLayers.Tile.prototype.draw.apply(this, arguments)) {
return false;
if (OpenLayers.Tile.prototype.draw.apply(this, arguments)) {
this.loadFeaturesForRegion(this.requestSuccess);
}
this.loadFeaturesForRegion(this.requestSuccess);
this.drawn = true;
return true;
},
/** get the full request string from the ds and the tile params
@@ -74,21 +71,12 @@ OpenLayers.Tile.WFS.prototype =
* @param {function} failure
*/
loadFeaturesForRegion:function(success, failure) {
if (this.urls != null) {
for(var i=0; i < this.urls.length; i++) {
var params = { BBOX:this.bounds.toBBOX() };
var url = this.urls[i] + "&" +
OpenLayers.Util.getParameterString(params);
OpenLayers.loadURL(url, null, this, success, failure);
}
}
OpenLayers.loadURL(this.url, null, this, success);
},
/** Return from AJAX request
*
* @param {XMLHttpRequest} request
* @param {} request
*/
requestSuccess:function(request) {
var doc = request.responseXML;
@@ -96,9 +84,13 @@ OpenLayers.Tile.WFS.prototype =
if (!doc || request.fileType!="XML") {
doc = OpenLayers.parseXMLString(request.responseText);
}
var resultFeatures = OpenLayers.Ajax.getElementsByTagNameNS(doc, "http://www.opengis.net/gml","gml", "featureMember");
this.addResults(resultFeatures);
if (this.layer.vectorMode) {
var gml = new OpenLayers.Format.GML({extractAttributes: this.layer.options.extractAttributes});
this.layer.addFeatures(gml.read(doc));
} else {
var resultFeatures = OpenLayers.Ajax.getElementsByTagNameNS(doc, "http://www.opengis.net/gml","gml", "featureMember");
this.addResults(resultFeatures);
}
},
/**
@@ -112,6 +104,7 @@ OpenLayers.Tile.WFS.prototype =
}
},
/** Iterate through and call destroy() on each feature, removing it from
* the local array
*
@@ -128,5 +121,3 @@ OpenLayers.Tile.WFS.prototype =
CLASS_NAME: "OpenLayers.Tile.WFS"
}
);