From 37de9273a7e95ed72e02491cd6421d54493537a8 Mon Sep 17 00:00:00 2001 From: fredj Date: Mon, 14 Nov 2011 13:14:28 +0100 Subject: [PATCH] move OpenLayers.Feature.WFS into deprecated.js. --- lib/OpenLayers.js | 1 - lib/OpenLayers/Feature/WFS.js | 80 ----------------------------------- lib/deprecated.js | 69 ++++++++++++++++++++++++++++++ 3 files changed, 69 insertions(+), 81 deletions(-) delete mode 100644 lib/OpenLayers/Feature/WFS.js diff --git a/lib/OpenLayers.js b/lib/OpenLayers.js index 19b1da3ca6..dfb6160dba 100644 --- a/lib/OpenLayers.js +++ b/lib/OpenLayers.js @@ -158,7 +158,6 @@ "OpenLayers/Popup/FramedCloud.js", "OpenLayers/Feature.js", "OpenLayers/Feature/Vector.js", - "OpenLayers/Feature/WFS.js", "OpenLayers/Handler.js", "OpenLayers/Handler/Click.js", "OpenLayers/Handler/Hover.js", diff --git a/lib/OpenLayers/Feature/WFS.js b/lib/OpenLayers/Feature/WFS.js deleted file mode 100644 index 7234e4fd5a..0000000000 --- a/lib/OpenLayers/Feature/WFS.js +++ /dev/null @@ -1,80 +0,0 @@ -/* Copyright (c) 2006-2011 by OpenLayers Contributors (see authors.txt for - * full list of contributors). Published under the Clear BSD license. - * See http://svn.openlayers.org/trunk/openlayers/license.txt for the - * full text of the license. */ - -/** - * @requires OpenLayers/Feature.js - */ - -/** - * Class: OpenLayers.Feature.WFS - * WFS handling class, for use as a featureClass on the WFS layer for handling - * 'point' WFS types. Good for subclassing when creating a custom WFS like - * XML application. - * - * Inherits from: - * - - */ -OpenLayers.Feature.WFS = OpenLayers.Class(OpenLayers.Feature, { - - /** - * Constructor: OpenLayers.Feature.WFS - * Create a WFS feature. - * - * Parameters: - * layer - {} - * xmlNode - {XMLNode} - */ - initialize: function(layer, xmlNode) { - var newArguments = arguments; - var data = this.processXMLNode(xmlNode); - newArguments = new Array(layer, data.lonlat, data); - OpenLayers.Feature.prototype.initialize.apply(this, newArguments); - this.createMarker(); - this.layer.addMarker(this.marker); - }, - - /** - * Method: destroy - * nullify references to prevent circular references and memory leaks - */ - destroy: function() { - if (this.marker != null) { - this.layer.removeMarker(this.marker); - } - OpenLayers.Feature.prototype.destroy.apply(this, arguments); - }, - - /** - * Method: processXMLNode - * When passed an xmlNode, parses it for a GML point, and passes - * back an object describing that point. - * - * For subclasses of Feature.WFS, this is the feature to change. - * - * Parameters: - * xmlNode - {XMLNode} - * - * Returns: - * {Object} Data Object with 'id', 'lonlat', and private properties set - */ - processXMLNode: function(xmlNode) { - //this should be overridden by subclasses - // must return an Object with 'id' and 'lonlat' values set - var point = OpenLayers.Ajax.getElementsByTagNameNS(xmlNode, "http://www.opengis.net/gml", "gml", "Point"); - var text = OpenLayers.Util.getXmlNodeValue(OpenLayers.Ajax.getElementsByTagNameNS(point[0], "http://www.opengis.net/gml","gml", "coordinates")[0]); - var floats = text.split(","); - return {lonlat: new OpenLayers.LonLat(parseFloat(floats[0]), - parseFloat(floats[1])), - id: null}; - - }, - - CLASS_NAME: "OpenLayers.Feature.WFS" -}); - - - - - diff --git a/lib/deprecated.js b/lib/deprecated.js index fc0e11bf38..bc101b8b99 100644 --- a/lib/deprecated.js +++ b/lib/deprecated.js @@ -12,6 +12,7 @@ * @requires OpenLayers/Layer/Markers.js * @requires OpenLayers/Console.js * @requires OpenLayers/Lang.js + * @requires OpenLayers/Feature.js */ /** @@ -2233,6 +2234,74 @@ OpenLayers.Tile.WFS = OpenLayers.Class(OpenLayers.Tile, { } ); +/** + * Class: OpenLayers.Feature.WFS + * WFS handling class, for use as a featureClass on the WFS layer for handling + * 'point' WFS types. Good for subclassing when creating a custom WFS like + * XML application. + * + * Inherits from: + * - + */ +OpenLayers.Feature.WFS = OpenLayers.Class(OpenLayers.Feature, { + + /** + * Constructor: OpenLayers.Feature.WFS + * Create a WFS feature. + * + * Parameters: + * layer - {} + * xmlNode - {XMLNode} + */ + initialize: function(layer, xmlNode) { + var newArguments = arguments; + var data = this.processXMLNode(xmlNode); + newArguments = new Array(layer, data.lonlat, data); + OpenLayers.Feature.prototype.initialize.apply(this, newArguments); + this.createMarker(); + this.layer.addMarker(this.marker); + }, + + /** + * Method: destroy + * nullify references to prevent circular references and memory leaks + */ + destroy: function() { + if (this.marker != null) { + this.layer.removeMarker(this.marker); + } + OpenLayers.Feature.prototype.destroy.apply(this, arguments); + }, + + /** + * Method: processXMLNode + * When passed an xmlNode, parses it for a GML point, and passes + * back an object describing that point. + * + * For subclasses of Feature.WFS, this is the feature to change. + * + * Parameters: + * xmlNode - {XMLNode} + * + * Returns: + * {Object} Data Object with 'id', 'lonlat', and private properties set + */ + processXMLNode: function(xmlNode) { + //this should be overridden by subclasses + // must return an Object with 'id' and 'lonlat' values set + var point = OpenLayers.Ajax.getElementsByTagNameNS(xmlNode, "http://www.opengis.net/gml", "gml", "Point"); + var text = OpenLayers.Util.getXmlNodeValue(OpenLayers.Ajax.getElementsByTagNameNS(point[0], "http://www.opengis.net/gml","gml", "coordinates")[0]); + var floats = text.split(","); + return {lonlat: new OpenLayers.LonLat(parseFloat(floats[0]), + parseFloat(floats[1])), + id: null}; + + }, + + CLASS_NAME: "OpenLayers.Feature.WFS" +}); + + /** * Class: OpenLayers.Layer.WFS * *Deprecated*. To be removed in 3.0. Instead use OpenLayers.Layer.Vector