[OpenLayers-Commits] r10930 - in sandbox/bartvde/openls/openlayers: examples lib/OpenLayers/Format/XLS

commits-20090109 at openlayers.org commits-20090109 at openlayers.org
Tue Nov 30 04:46:18 EST 2010


Author: bartvde
Date: 2010-11-30 01:46:18 -0800 (Tue, 30 Nov 2010)
New Revision: 10930

Modified:
   sandbox/bartvde/openls/openlayers/examples/openls.html
   sandbox/bartvde/openls/openlayers/lib/OpenLayers/Format/XLS/v1.js
Log:
address is 1:n relationship, and putting back the xls: prefix since ESRI has updated their servlet

Modified: sandbox/bartvde/openls/openlayers/examples/openls.html
===================================================================
--- sandbox/bartvde/openls/openlayers/examples/openls.html	2010-11-29 14:10:31 UTC (rev 10929)
+++ sandbox/bartvde/openls/openlayers/examples/openls.html	2010-11-30 09:46:18 UTC (rev 10930)
@@ -18,7 +18,7 @@
                 countrySubdivision: 'RI',
                 postalCode: '02909'
             };
-            var request = format.write({address: address});
+            var request = format.write({addresses: [address]});
             console.log(request);
         }
     </script>

Modified: sandbox/bartvde/openls/openlayers/lib/OpenLayers/Format/XLS/v1.js
===================================================================
--- sandbox/bartvde/openls/openlayers/lib/OpenLayers/Format/XLS/v1.js	2010-11-29 14:10:31 UTC (rev 10929)
+++ sandbox/bartvde/openls/openlayers/lib/OpenLayers/Format/XLS/v1.js	2010-11-30 09:46:18 UTC (rev 10930)
@@ -116,7 +116,7 @@
         "xls": {
             "XLS": function(request) {
                 var root = this.createElementNSPlus(
-                    "XLS",
+                    "xls:XLS",
                     {attributes: {
                         "version": this.VERSION,
                         "xsi:schemaLocation": this.schemaLocation
@@ -127,26 +127,28 @@
                 return root;
             },
             "RequestHeader": function(header) {
-                return this.createElementNSPlus("RequestHeader");
+                return this.createElementNSPlus("xls:RequestHeader");
             },
             "Request": function(request) {
-                var node = this.createElementNSPlus("Request", {
+                var node = this.createElementNSPlus("xls:Request", {
                     attributes: {
                         methodName: "GeocodeRequest",
                         requestID: request.requestID || "",
                         version: this.VERSION
                     }
                 });
-                this.writeNode("GeocodeRequest", request.address, node);
+                this.writeNode("GeocodeRequest", request.addresses, node);
                 return node;
             },
-            "GeocodeRequest": function(address) {
-                var node = this.createElementNSPlus("GeocodeRequest");
-                this.writeNode("Address", address, node);
+            "GeocodeRequest": function(addresses) {
+                var node = this.createElementNSPlus("xls:GeocodeRequest");
+                for (var i=0, len=addresses.length; i<len; i++) {
+                    this.writeNode("Address", addresses[i], node);
+                }
                 return node;
             },
             "Address": function(address) {
-                var node = this.createElementNSPlus("Address", {
+                var node = this.createElementNSPlus("xls:Address", {
                     attributes: {
                         countryCode: address.countryCode
                     }
@@ -166,16 +168,16 @@
                 return node;
             },
             "StreetAddress": function(street) {
-                var node = this.createElementNSPlus("StreetAddress");
+                var node = this.createElementNSPlus("xls:StreetAddress");
                 this.writeNode("Street", street, node);
                 return node; 
                 
             },
             "Street": function(street) {
-                return this.createElementNSPlus("Street", {value: street});
+                return this.createElementNSPlus("xls:Street", {value: street});
             },
             "Municipality": function(municipality) {
-                return this.createElementNSPlus("Place", {
+                return this.createElementNSPlus("xls:Place", {
                     attributes: {
                         type: "Municipality"
                     },
@@ -183,7 +185,7 @@
                 });
             },
             "CountrySubdivision": function(countrySubdivision) {
-                return this.createElementNSPlus("Place", {
+                return this.createElementNSPlus("xls:Place", {
                     attributes: {
                         type: "CountrySubdivision"
                     },
@@ -191,7 +193,7 @@
                 });
             },
             "PostalCode": function(postalCode) {
-                return this.createElementNSPlus("PostalCode", {
+                return this.createElementNSPlus("xls:PostalCode", {
                     value: postalCode
                 });
             }



More information about the Commits mailing list