Made WFS at least display points by default.
git-svn-id: http://svn.openlayers.org/branches/openlayers/1.0@785 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -43,8 +43,15 @@ OpenLayers.Feature.WFS.prototype =
|
|||||||
*/
|
*/
|
||||||
processXMLNode: function(xmlNode) {
|
processXMLNode: function(xmlNode) {
|
||||||
//this should be overridden by subclasses
|
//this should be overridden by subclasses
|
||||||
|
|
||||||
// must return an Object with 'id' and 'lonlat' values set
|
// must return an Object with 'id' and 'lonlat' values set
|
||||||
|
var point = xmlNode.getElementsByTagName("Point");
|
||||||
|
var text = point[0].textContent;
|
||||||
|
var floats = text.split(",");
|
||||||
|
|
||||||
|
return {lonlat: new OpenLayers.LonLat(parseFloat(floats[0]),
|
||||||
|
parseFloat(floats[1])),
|
||||||
|
id: null};
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/** @final @type String */
|
/** @final @type String */
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ OpenLayers.Layer.WFS.prototype =
|
|||||||
Object.extend(new OpenLayers.Layer.Markers(), {
|
Object.extend(new OpenLayers.Layer.Markers(), {
|
||||||
|
|
||||||
/** @type Object */
|
/** @type Object */
|
||||||
featureClass: null,
|
featureClass: OpenLayers.Feature.WFS,
|
||||||
|
|
||||||
/** @final @type hash */
|
/** @final @type hash */
|
||||||
DEFAULT_PARAMS: { service: "WFS",
|
DEFAULT_PARAMS: { service: "WFS",
|
||||||
@@ -30,7 +30,7 @@ OpenLayers.Layer.WFS.prototype =
|
|||||||
* @param {Object} featureClass
|
* @param {Object} featureClass
|
||||||
*/
|
*/
|
||||||
initialize: function(name, url, params, featureClass) {
|
initialize: function(name, url, params, featureClass) {
|
||||||
this.featureClass = featureClass;
|
if (featureClass != null) this.featureClass = featureClass;
|
||||||
|
|
||||||
var newArguments = new Array();
|
var newArguments = new Array();
|
||||||
if (arguments.length > 0) {
|
if (arguments.length > 0) {
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ OpenLayers.Tile.WFS.prototype =
|
|||||||
doc = OpenLayers.parseXMLString(request.responseText);
|
doc = OpenLayers.parseXMLString(request.responseText);
|
||||||
}
|
}
|
||||||
|
|
||||||
var resultFeatures = OpenLayers.Util.getNodes(doc, "gml:featureMember");
|
var resultFeatures = doc.getElementsByTagName("featureMember");
|
||||||
|
|
||||||
//clear old featureList
|
//clear old featureList
|
||||||
this.features = new Array();
|
this.features = new Array();
|
||||||
|
|||||||
Reference in New Issue
Block a user