From 02901cb09a24152083d081146c75cb5115374397 Mon Sep 17 00:00:00 2001 From: euzuro Date: Fri, 26 May 2006 23:01:33 +0000 Subject: [PATCH] add OpenLayers.Feature.WFS class as a blueprint for subclassing. git-svn-id: http://svn.openlayers.org/trunk/openlayers@408 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/Feature/WFS.js | 45 +++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 lib/OpenLayers/Feature/WFS.js diff --git a/lib/OpenLayers/Feature/WFS.js b/lib/OpenLayers/Feature/WFS.js new file mode 100644 index 0000000000..f1bc41c77e --- /dev/null +++ b/lib/OpenLayers/Feature/WFS.js @@ -0,0 +1,45 @@ +/** + * @class + */ +OpenLayers.Feature.WFS = Class.create(); +OpenLayers.Feature.WFS.prototype = + Object.extend( new OpenLayers.Feature(), { + + /** + * @constructor + * + * @param {OpenLayers.Layer} layer + * @param {XMLNode} xmlNode + */ + initialize: function(layer, xmlNode) { + var newArguments = arguments; + if (arguments.length > 0) { + var data = this.processXMLNode(xmlNode); + newArguments = new Array(layer, data.id, data.lonlat, data) + } + OpenLayers.Feature.prototype.initialize.apply(this, newArguments); + + this.createMarker(); + this.layer.addMarker(this.marker); + }, + + /** + * @param {XMLNode} xmlNode + * + * @returns Data Object with 'id', 'lonlat', and private properties set + * @type Object + */ + processXMLNode: function(xmlNode) { + //this should be overridden by subclasses + + // must return an Object with 'id' and 'lonlat' values set + }, + + /** @final @type String */ + CLASS_NAME: "OpenLayers.Feature.WFS" +}); + + + + +