[OpenLayers-Commits] r4769 - in trunk/openlayers: lib/OpenLayers/Format tests/Format

commits at openlayers.org commits at openlayers.org
Wed Oct 3 01:30:19 EDT 2007


Author: crschmidt
Date: 2007-10-03 01:30:17 -0400 (Wed, 03 Oct 2007)
New Revision: 4769

Modified:
   trunk/openlayers/lib/OpenLayers/Format/GeoRSS.js
   trunk/openlayers/tests/Format/test_GeoRSS.html
Log:
Support W3C Geo in Format.GeoRSS -- this.geons was referenced ,but never
defined. Add property and test. Reviewed by SDE (thx!), (See #1024) 


Modified: trunk/openlayers/lib/OpenLayers/Format/GeoRSS.js
===================================================================
--- trunk/openlayers/lib/OpenLayers/Format/GeoRSS.js	2007-10-03 05:27:48 UTC (rev 4768)
+++ trunk/openlayers/lib/OpenLayers/Format/GeoRSS.js	2007-10-03 05:30:17 UTC (rev 4769)
@@ -38,6 +38,13 @@
      *     "http://www.georss.org/georss"
      */
     georssns: "http://www.georss.org/georss",
+
+    /**
+     * APIProperty: geons
+     * {String} W3C Geo namespace to use.  Defaults to
+     *     "http://www.w3.org/2003/01/geo/wgs84_pos#"
+     */
+    geons: "http://www.w3.org/2003/01/geo/wgs84_pos#",
     
     /**
      * APIProperty: featureTitle

Modified: trunk/openlayers/tests/Format/test_GeoRSS.html
===================================================================
--- trunk/openlayers/tests/Format/test_GeoRSS.html	2007-10-03 05:27:48 UTC (rev 4768)
+++ trunk/openlayers/tests/Format/test_GeoRSS.html	2007-10-03 05:30:17 UTC (rev 4769)
@@ -26,6 +26,14 @@
         var data = parser.write([f]);
         t.eq(data, '<rss xmlns="http://backend.userland.com/rss2"><item><title></title><description></description><georss:line xmlns:georss="http://www.georss.org/georss">45.68 -111.04 45.68 -112.04</georss:line></item></rss>', 'GeoRSS serializes a line correctly');
     }
+    function test_Format_GeoRSS_w3cgeo(t) { 
+        t.plan(2);
+
+        var parser = new OpenLayers.Format.GeoRSS();
+        var data = parser.read('<rss xmlns="http://backend.userland.com/rss2" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#"><item><geo:long>-1</geo:long><geo:lat>1</geo:long></item></rss>');
+        t.eq(features.geometry.x, "-1", "w3c geo x read correctly"); 
+        t.eq(features.geometry.y, "1", "w3c geo y read correctly"); 
+    }
     function test_Format_GeoRSS_roundtrip(t) {
         t.plan(input.length);
         var parser = new OpenLayers.Format.GeoRSS();



More information about the Commits mailing list