From 64f2c94c29a9ea69aba7e8c3114254cbe5a37596 Mon Sep 17 00:00:00 2001 From: Tim Schaub Date: Tue, 3 Feb 2009 21:01:32 +0000 Subject: [PATCH] Adding a test to confirm that reading of boundedBy works for GML 2 as well (see #1918, #1613) git-svn-id: http://svn.openlayers.org/trunk/openlayers@8809 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- tests/Format/GML/v2.html | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/tests/Format/GML/v2.html b/tests/Format/GML/v2.html index 730e7eaf41..3a123354d6 100644 --- a/tests/Format/GML/v2.html +++ b/tests/Format/GML/v2.html @@ -176,6 +176,25 @@ t.eq(attributes["STATE_ABBR"], "IL", "read STATE_ABBR"); t.eq(attributes["LAND_KM"], "143986.61", "read LAND_KM"); } + + function test_boundedBy(t) { + t.plan(5); + + var doc = readXML("v2/boundedBy.xml"); + var format = new OpenLayers.Format.GML.v2({ + featureType: "states", + featureNS: "http://www.openplans.org/topp", + geometryName: "the_geom", + xy: false + }); + var features = format.read(doc.documentElement); + var geom = features[0].geometry; + t.ok(geom.bounds instanceof OpenLayers.Bounds, "geometry given a bounds"); + t.eq(geom.bounds.left.toFixed(2), "-91.52", "bounds left correct"); + t.eq(geom.bounds.bottom.toFixed(2), "36.99", "bounds bottom correct"); + t.eq(geom.bounds.right.toFixed(2), "-87.51", "bounds right correct"); + t.eq(geom.bounds.top.toFixed(2), "42.51", "bounds top correct"); + } function test_write(t) { t.plan(1); @@ -601,5 +620,8 @@
+