[OpenLayers-Commits] r2356 - in sandbox/vector-2.4/lib/OpenLayers: . Format

commits at openlayers.org commits at openlayers.org
Mon Mar 5 18:45:38 EST 2007


Author: crschmidt
Date: 2007-03-05 18:45:32 -0500 (Mon, 05 Mar 2007)
New Revision: 2356

Added:
   sandbox/vector-2.4/lib/OpenLayers/Format.js
   sandbox/vector-2.4/lib/OpenLayers/Format/
   sandbox/vector-2.4/lib/OpenLayers/Format/GML.js
Log:
Add GML Format class. This is serialize/deserialize code.


Added: sandbox/vector-2.4/lib/OpenLayers/Format/GML.js
===================================================================
--- sandbox/vector-2.4/lib/OpenLayers/Format/GML.js	                        (rev 0)
+++ sandbox/vector-2.4/lib/OpenLayers/Format/GML.js	2007-03-05 23:45:32 UTC (rev 2356)
@@ -0,0 +1,26 @@
+/* Copyright (c) 2006 MetaCarta, Inc., published under a modified BSD license.
+ * See http://svn.openlayers.org/trunk/openlayers/repository-license.txt 
+ * for the full text of the license. */
+
+/**
+ * Read/WRite GML. 
+ */
+OpenLayers.Format.GML = OpenLayers.Class.create();
+OpenLayers.Format.GML.prototype = 
+  OpenLayers.inherit( OpenLayers.Format, {
+    /**
+     * Read data from a string, and return a list of features. 
+     * 
+     * @param {string} data data to read/parse.
+     */
+     read: function(data) {
+     },
+    
+    /**
+     * Accept Feature Collection, and return a string. 
+     * 
+     * @param {Array} List of features to serialize into a string.
+     */
+     write: function(features) {
+     }
+});     

Added: sandbox/vector-2.4/lib/OpenLayers/Format.js
===================================================================
--- sandbox/vector-2.4/lib/OpenLayers/Format.js	                        (rev 0)
+++ sandbox/vector-2.4/lib/OpenLayers/Format.js	2007-03-05 23:45:32 UTC (rev 2356)
@@ -0,0 +1,27 @@
+/* Copyright (c) 2006 MetaCarta, Inc., published under a modified BSD license.
+ * See http://svn.openlayers.org/trunk/openlayers/repository-license.txt 
+ * for the full text of the license. */
+
+/**
+ * Base class for format reading/writing. 
+ */
+OpenLayers.Format = OpenLayers.Class.create();
+OpenLayers.Format.prototype = {
+    /**
+     * Read data from a string, and return a list of features. 
+     * 
+     * @param {string} data data to read/parse.
+     */
+     read: function(data) {
+         alert("Read not implemented.");
+     },
+    
+    /**
+     * Accept Feature Collection, and return a string. 
+     * 
+     * @param {Array} List of features to serialize into a string.
+     */
+     write: function(features) {
+         alert("Write not implemented.");
+     },
+};     



More information about the Commits mailing list