+ function loadFeatureList() {
+ gml.addFeatures(featureList);
+ gml.events.triggerEvent("loadend");
+ }
+
+ function customDataLoader(request) {
+ var doc = request.responseXML;
+
+ if (!doc || !doc.documentElement) {
+ doc = request.responseText;
+ }
+
+ var options = {};
+
+ OpenLayers.Util.extend(options, this.formatOptions);
+ if (this.map && !this.projection.equals(this.map.getProjectionObject())) {
+ options.externalProjection = this.projection;
+ options.internalProjection = this.map.getProjectionObject();
+ }
+
+ var gml = this.format ? new this.format(options) : new OpenLayers.Format.GML(options);
+ var features = gml.read(doc);
+ if (!this.maxFeatures || features.length <= this.maxFeatures) {
+ this.addFeatures(features);
+ this.events.triggerEvent("loadend");
+ featureList = [];
+ } else {
+ featureList = features;
+ displayFeatureWarning();
+ }
+ }
+