From cb3cde8d1c9e2658258352c93e025129fdf6660e Mon Sep 17 00:00:00 2001 From: crschmidt Date: Wed, 3 Oct 2007 05:30:17 +0000 Subject: [PATCH] Support W3C Geo in Format.GeoRSS -- this.geons was referenced ,but never defined. Add property and test. Reviewed by SDE (thx!), (See #1024) git-svn-id: http://svn.openlayers.org/trunk/openlayers@4769 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/Format/GeoRSS.js | 7 +++++++ tests/Format/test_GeoRSS.html | 8 ++++++++ 2 files changed, 15 insertions(+) diff --git a/lib/OpenLayers/Format/GeoRSS.js b/lib/OpenLayers/Format/GeoRSS.js index 9435a38c3b..6dd80af5ec 100644 --- a/lib/OpenLayers/Format/GeoRSS.js +++ b/lib/OpenLayers/Format/GeoRSS.js @@ -38,6 +38,13 @@ OpenLayers.Format.GeoRSS = OpenLayers.Class(OpenLayers.Format.XML, { * "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 diff --git a/tests/Format/test_GeoRSS.html b/tests/Format/test_GeoRSS.html index 90c32c8c29..b8b5490796 100644 --- a/tests/Format/test_GeoRSS.html +++ b/tests/Format/test_GeoRSS.html @@ -26,6 +26,14 @@ var data = parser.write([f]); t.eq(data, '45.68 -111.04 45.68 -112.04', 'GeoRSS serializes a line correctly'); } + function test_Format_GeoRSS_w3cgeo(t) { + t.plan(2); + + var parser = new OpenLayers.Format.GeoRSS(); + var data = parser.read('-11'); + 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();