Changeset 7885
- Timestamp:
- 08/28/08 14:41:00 (3 months ago)
- Files:
-
- trunk/openlayers/lib/OpenLayers/Geometry/Collection.js (modified) (1 diff)
- trunk/openlayers/lib/OpenLayers/Geometry/LinearRing.js (modified) (1 diff)
- trunk/openlayers/lib/OpenLayers/Geometry/Point.js (modified) (1 diff)
- trunk/openlayers/tests/Geometry/Collection.html (modified) (1 diff)
- trunk/openlayers/tests/Geometry/Point.html (modified) (1 diff)
- trunk/openlayers/tests/Geometry/Polygon.html (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/openlayers/lib/OpenLayers/Geometry/Collection.js
r7704 r7885 326 326 component.transform(source, dest); 327 327 } 328 } 328 this.bounds = null; 329 } 329 330 return this; 330 331 }, trunk/openlayers/lib/OpenLayers/Geometry/LinearRing.js
r7627 r7885 173 173 component.transform(source, dest); 174 174 } 175 this.bounds = null; 175 176 } 176 177 return this; trunk/openlayers/lib/OpenLayers/Geometry/Point.js
r5614 r7885 207 207 OpenLayers.Projection.transform( 208 208 this, source, dest); 209 this.bounds = null; 209 210 } 210 211 return this; trunk/openlayers/tests/Geometry/Collection.html
r6724 r7885 227 227 } 228 228 229 function test_transform(t) { 230 t.plan(5); 231 var p1 = new OpenLayers.Geometry.Point(0,0); 232 p1.bounds = "foo"; 233 var p2 = new OpenLayers.Geometry.Point(1,1); 234 p2.bounds = "foo"; 235 var line = new OpenLayers.Geometry.LineString([p1, p2]); 236 var multipoint = new OpenLayers.Geometry.MultiPoint([p1, p2]); 237 var coll = new OpenLayers.Geometry.Collection([ 238 p1, p2, line, multipoint 239 ]); 240 coll.bounds = "foo"; 241 242 var wgs84 = new OpenLayers.Projection("EPSG:4326"); 243 var sm = new OpenLayers.Projection("EPSG:900913"); 244 coll.transform(wgs84, sm); 245 246 t.eq(coll.bounds, null, "coll bounds cleared"); 247 t.eq(p1.bounds, null, "p1 component bounds cleared"); 248 t.eq(p2.bounds, null, "p2 component bounds cleared"); 249 t.eq(line.bounds, null, "line component bounds cleared"); 250 t.eq(multipoint.bounds, null, "multipoint component bounds cleared"); 251 252 } 253 229 254 function test_Collection_destroy(t) { 230 255 t.plan( 1 ); trunk/openlayers/tests/Geometry/Point.html
r6724 r7885 36 36 t.eq( point.bounds.top, y, "bounds.top is 20" ); 37 37 t.eq( point.bounds.bottom, y, "bounds.bottom is 20" ); 38 } 39 40 41 function test_Point_transform_getBounds (t) { 42 t.plan(2); 43 44 var x = 10; 45 var y = 20; 46 point = new OpenLayers.Geometry.Point(x, y); 47 point.calculateBounds(); 48 t.ok( point.bounds != null, "bounds calculated by calcBounds" ); 49 point.transform(new OpenLayers.Projection("EPSG:4326"), 50 new OpenLayers.Projection("EPSG:900913")); 51 t.eq(point.bounds, null, "Point bounds cleared after transform"); 38 52 } 39 53 trunk/openlayers/tests/Geometry/Polygon.html
r6724 r7885 33 33 } 34 34 35 function test_Polygon_transform_getBounds (t) { 36 t.plan(3); 37 38 var components = [new OpenLayers.Geometry.Point(10,14), new OpenLayers.Geometry.Point(5,3)]; 39 var linearRing = new OpenLayers.Geometry.LinearRing(components); 40 polygon = new OpenLayers.Geometry.Polygon([linearRing.clone()]); 41 polygon.calculateBounds(); 42 t.ok( polygon.bounds != null, "bounds calculated by calcBounds" ); 43 polygon.transform(new OpenLayers.Projection("EPSG:4326"), 44 new OpenLayers.Projection("EPSG:900913")); 45 t.eq(polygon.bounds, null, "Point bounds cleared after transform"); 46 t.eq(polygon.getBounds().toBBOX(), "556597.453889,334111.171355,1113194.907778,1574216.547942", "Bounds are correct") 47 } 48 35 49 function test_Polygon_getArea(t) { 36 50 t.plan( 5 );
