Changeset 4794
- Timestamp:
- 10/03/07 15:27:15 (2 years ago)
- Files:
-
- branches/openlayers/2.5/examples/spherical-mercator.html (modified) (1 diff)
- branches/openlayers/2.5/lib/OpenLayers/Format/GeoJSON.js (modified) (8 diffs)
- branches/openlayers/2.5/lib/OpenLayers/Format/GeoRSS.js (modified) (1 diff)
- branches/openlayers/2.5/lib/OpenLayers/Layer/MapServer/Untiled.js (modified) (1 diff)
- branches/openlayers/2.5/lib/OpenLayers/Layer/TMS.js (modified) (2 diffs)
- branches/openlayers/2.5/lib/OpenLayers/Layer/WFS.js (modified) (1 diff)
- branches/openlayers/2.5/lib/OpenLayers/Layer/WMS/Untiled.js (modified) (1 diff)
- branches/openlayers/2.5/lib/OpenLayers/Layer/Yahoo.js (modified) (1 diff)
- branches/openlayers/2.5/lib/OpenLayers/Util.js (modified) (1 diff)
- branches/openlayers/2.5/tests/Format/test_GeoJSON.html (modified) (6 diffs)
- branches/openlayers/2.5/tests/Format/test_GeoRSS.html (modified) (1 diff)
- branches/openlayers/2.5/tests/Layer/test_MapServer.html (modified) (1 diff)
- branches/openlayers/2.5/tests/Layer/test_TMS.html (modified) (2 diffs)
- branches/openlayers/2.5/tests/Layer/test_WMS.html (modified) (1 diff)
- branches/openlayers/2.5/tests/test_Util.html (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/openlayers/2.5/examples/spherical-mercator.html
r4260 r4794 100 100 101 101 map.addLayers([gmap, gsat, ghyb, veroad, veaer, vehyb, 102 yahoo, yahoosat, yahoohyb, mapnik, wms ]);102 yahoo, yahoosat, yahoohyb, mapnik, wms, vector]); 103 103 map.addControl(new OpenLayers.Control.LayerSwitcher()); 104 104 map.addControl(new OpenLayers.Control.EditingToolbar(vector)); branches/openlayers/2.5/lib/OpenLayers/Format/GeoJSON.js
r4390 r4794 94 94 case "GeometryCollection": 95 95 results = []; 96 for(var i=0; i<obj. members.length; ++i) {96 for(var i=0; i<obj.geometries.length; ++i) { 97 97 try { 98 results.push(this.parseGeometry(obj. members[i]));98 results.push(this.parseGeometry(obj.geometries[i])); 99 99 } catch(err) { 100 100 results = null; … … 116 116 break; 117 117 case "FeatureCollection": 118 for(var i=0; i<obj. members.length; ++i) {118 for(var i=0; i<obj.features.length; ++i) { 119 119 try { 120 results.push(this.parseFeature(obj. members[i]));120 results.push(this.parseFeature(obj.features[i])); 121 121 } catch(err) { 122 122 results = null; … … 126 126 break; 127 127 case "GeometryCollection": 128 for(var i=0; i<obj. members.length; ++i) {128 for(var i=0; i<obj.geometries.length; ++i) { 129 129 try { 130 var geom = this.parseGeometry(obj. members[i]);130 var geom = this.parseGeometry(obj.geometries[i]); 131 131 results.push(new OpenLayers.Feature.Vector(geom)); 132 132 } catch(err) { … … 437 437 }; 438 438 if(obj instanceof Array) { 439 geojson.members = []; 439 if(obj[0] instanceof OpenLayers.Feature.Vector) { 440 geojson.features = []; 441 } else if (obj[0].CLASS_NAME.search("OpenLayers.Geometry") == 0) { 442 geojson.geometries = []; 443 } 440 444 for(var i=0; i<obj.length; ++i) { 441 445 var element = obj[i]; … … 444 448 geojson.type = "FeatureCollection"; 445 449 if(element.layer && element.layer.projection) { 446 var proj = element.layer.projection; 447 if(proj.match(/epsg:/i)) { 448 geojson.crs = { 449 "type": "EPSG", 450 "properties": { 451 "code": parseInt(proj.substring(proj.indexOf(":") + 1)) 452 } 453 }; 454 } 450 this.createCRSObject(element); 455 451 } 456 452 } else if(geojson.type != "FeatureCollection") { … … 458 454 break; 459 455 } 460 geojson. members.push(this.extract.feature.apply(this, [element]));456 geojson.features.push(this.extract.feature.apply(this, [element])); 461 457 } else if (element.CLASS_NAME.search("OpenLayers.Geometry") == 0) { 462 458 if(geojson.type == null) { … … 466 462 break; 467 463 } 468 geojson. members.push(this.extract.geometry.apply(this, [element]));464 geojson.geometries.push(this.extract.geometry.apply(this, [element])); 469 465 } 470 466 } … … 474 470 geojson = this.extract.feature.apply(this, [obj]); 475 471 if(obj.layer && obj.layer.projection) { 476 var proj = obj.layer.projection; 477 if(proj.match(/epsg:/i)) { 478 geojson.crs = { 479 "type": "EPSG", 480 "properties": { 481 "code": parseInt(proj.substring(proj.indexOf(":") + 1)) 482 } 483 }; 484 } 472 this.createCRSObject(obj); 485 473 } 486 474 } 487 475 return OpenLayers.Format.JSON.prototype.write.apply(this, 488 476 [geojson, pretty]); 477 }, 478 479 /** 480 * Method: createCRSObject 481 * Create the CRS object for an object. 482 */ 483 createCRSObject: function(object) { 484 var proj = object.layer.projection; 485 if (proj.match(/epsg:/i)) { 486 var code = parseInt(proj.substring(proj.indexOf(":") + 1)); 487 if (code == 4326) { 488 geojson.crs = { 489 "type": "OGC", 490 "properties": { 491 "urn": "urn:ogc:def:crs:OGC:1.3:CRS84" 492 } 493 }; 494 } else { 495 geojson.crs = { 496 "type": "EPSG", 497 "properties": { 498 "code": code 499 } 500 }; 501 } 502 } 489 503 }, 490 504 branches/openlayers/2.5/lib/OpenLayers/Format/GeoRSS.js
r4390 r4794 39 39 */ 40 40 georssns: "http://www.georss.org/georss", 41 42 /** 43 * APIProperty: geons 44 * {String} W3C Geo namespace to use. Defaults to 45 * "http://www.w3.org/2003/01/geo/wgs84_pos#" 46 */ 47 geons: "http://www.w3.org/2003/01/geo/wgs84_pos#", 41 48 42 49 /** branches/openlayers/2.5/lib/OpenLayers/Layer/MapServer/Untiled.js
r4223 r4794 41 41 }, 42 42 43 /** 44 * Method: clone 45 * Create a clone of this layer 46 * 47 * Returns: 48 * {<OpenLayers.Layer.MapServer.Untiled>} An exact clone of this layer 49 */ 50 clone: function (obj) { 51 52 if (obj == null) { 53 obj = new OpenLayers.Layer.MapServer.Untiled(this.name, 54 this.url, 55 this.params, 56 this.options); 57 } 58 59 //get all additions from superclasses 60 obj = OpenLayers.Layer.MapServer.prototype.clone.apply(this, [obj]); 61 62 // copy/set any non-init, non-simple values here 63 64 return obj; 65 }, 66 43 67 CLASS_NAME: "OpenLayers.Layer.MapServer.Untiled" 44 68 }); branches/openlayers/2.5/lib/OpenLayers/Layer/TMS.js
r4223 r4794 13 13 */ 14 14 OpenLayers.Layer.TMS = OpenLayers.Class(OpenLayers.Layer.Grid, { 15 16 /** 17 * APIProperty: serviceVersion 18 * {String} 19 */ 20 serviceVersion: "1.0.0", 15 21 16 22 /** … … 92 98 var y = Math.round((bounds.bottom - this.tileOrigin.lat) / (res * this.tileSize.h)); 93 99 var z = this.map.getZoom(); 94 var path = "1.0.0"+ "/" + this.layername + "/" + z + "/" + x + "/" + y + "." + this.type;100 var path = this.serviceVersion + "/" + this.layername + "/" + z + "/" + x + "/" + y + "." + this.type; 95 101 var url = this.url; 96 102 if (url instanceof Array) { branches/openlayers/2.5/lib/OpenLayers/Layer/WFS.js
r4318 r4794 256 256 this.tile = new OpenLayers.Tile.WFS(this, pos, tileBounds, 257 257 url, tileSize); 258 this.addTileMonitoringHooks(this.tile); 258 259 this.tile.draw(); 259 260 } branches/openlayers/2.5/lib/OpenLayers/Layer/WMS/Untiled.js
r4019 r4794 41 41 }, 42 42 43 /** 44 * Method: clone 45 * Create a clone of this layer 46 * 47 * Returns: 48 * {<OpenLayers.Layer.WMS.Untiled>} An exact clone of this layer 49 */ 50 clone: function (obj) { 51 52 if (obj == null) { 53 obj = new OpenLayers.Layer.WMS.Untiled(this.name, 54 this.url, 55 this.params, 56 this.options); 57 } 58 59 //get all additions from superclasses 60 obj = OpenLayers.Layer.WMS.prototype.clone.apply(this, [obj]); 61 62 // copy/set any non-init, non-simple values here 63 64 return obj; 65 }, 66 43 67 CLASS_NAME: "OpenLayers.Layer.WMS.Untiled" 44 68 }); branches/openlayers/2.5/lib/OpenLayers/Layer/Yahoo.js
r4223 r4794 92 92 this.mapObject = new YMap(this.div, this.type, size); 93 93 this.mapObject.disableKeyControls(); 94 this.mapObject.disableDragMap(); 94 95 } catch(e) {} 95 96 }, branches/openlayers/2.5/lib/OpenLayers/Util.js
r4302 r4794 992 992 993 993 if(element == document.body) { 994 if(OpenLayers.Element.getStyle(child, 'position') == 'absolute') { 994 // FIXME: IE, when passed 'window' as the forElement, treats it as 995 // equal to document.body, but window.style fails, so getStyle 996 // fails, so we are paranoid and check this here. This check should 997 // probably move into element.getStyle in 2.6. 998 if(child && child.style && 999 OpenLayers.Element.getStyle(child, 'position') == 'absolute') { 995 1000 break; 996 1001 } branches/openlayers/2.5/tests/Format/test_GeoJSON.html
r4156 r4794 4 4 <script type="text/javascript"> 5 5 6 var poly_content = '{"type": "FeatureCollection", " members": [{"geometry": {"type": "Polygon", "coordinates": [[[-131.484375, -5.9765625], [-112.5, -58.0078125], [-32.34375, -50.2734375], [-114.609375, 52.3828125], [-167.34375, -35.5078125], [-146.953125, -57.3046875], [-139.921875, -34.1015625], [-131.484375, -5.9765625]]]}, "type": "Feature", "id": 562, "properties": {"strokeColor": "red", "title": "Feature 2", "author": "Your Name Here"}}]}';6 var poly_content = '{"type": "FeatureCollection", "features": [{"geometry": {"type": "Polygon", "coordinates": [[[-131.484375, -5.9765625], [-112.5, -58.0078125], [-32.34375, -50.2734375], [-114.609375, 52.3828125], [-167.34375, -35.5078125], [-146.953125, -57.3046875], [-139.921875, -34.1015625], [-131.484375, -5.9765625]]]}, "type": "Feature", "id": 562, "properties": {"strokeColor": "red", "title": "Feature 2", "author": "Your Name Here"}}]}'; 7 7 var point_feature = '{"geometry": {"type": "Point", "coordinates": [94.21875, 72.94921875]}, "type": "Feature", "id": 573, "properties": {"strokeColor": "blue", "title": "Feature 5", "author": "Your Name Here"}}' 8 var line_feature = '{"type": "FeatureCollection", " members": [{"geometry": {"type": "LineString", "coordinates": [[-27.0703125, 59.4140625], [-77.6953125, 20.7421875], [30.5859375, -36.2109375], [67.1484375, 34.8046875]]}, "type": "Feature", "id": 559, "properties": {"strokeColor": "red", "title": "Feature 1", "author": "Your Name Here"}}]}';9 var multiple_features = '{"type": "FeatureCollection", " members": [{"geometry": {"type": "Point", "coordinates": [-91.0546875, 43.9453125]}, "type": "Feature", "id": 577, "properties": {"strokeColor": "red", "title": "Feature 2", "image": "foo.gif", "author": "Your Name Here"}}, {"geometry": {"type": "LineString", "coordinates": [[91.40625, -1.40625], [116.015625, -42.890625], [153.28125, -28.125], [108.984375, 11.25], [75.234375, 8.4375], [76.640625, 9.140625], [67.5, -36.5625], [67.5, -35.859375]]}, "type": "Feature", "id": 576, "properties": {"strokeColor": "red", "title": "Feature 1", "author": "Your Name Here"}}, {"geometry": {"type": "Point", "coordinates": [139.5703125, 57.48046875]}, "type": "Feature", "id": 575, "properties": {"strokeColor": "blue", "title": "Feature 7", "author": "Your Name Here"}}, {"geometry": {"type": "Point", "coordinates": [107.2265625, 82.44140625]}, "type": "Feature", "id": 574, "properties": {"strokeColor": "blue", "title": "Feature 6", "author": "Your Name Here"}}, {"geometry": {"type": "Point", "coordinates": [94.21875, 72.94921875]}, "type": "Feature", "id": 573, "properties": {"strokeColor": "blue", "title": "Feature 5", "author": "Your Name Here"}}, {"geometry": {"type": "Point", "coordinates": [116.3671875, 61.69921875]}, "type": "Feature", "id": 572, "properties": {"strokeColor": "blue", "title": "Feature 4", "author": "Your Name Here"}}, {"geometry": {"type": "Point", "coordinates": [145.8984375, 73.65234375]}, "type": "Feature", "id": 571, "properties": {"strokeColor": "blue", "title": "Feature 3", "author": "Your Name Here"}}, {"geometry": {"type": "Polygon", "coordinates": [[[32.34375, 52.20703125], [87.1875, 70.13671875], [122.6953125, 37.44140625], [75.234375, 42.36328125], [40.078125, 42.36328125], [28.828125, 48.33984375], [18.6328125, 56.77734375], [23.203125, 65.56640625], [32.34375, 52.20703125]]]}, "type": "Feature", "id": 570, "properties": {"strokeColor": "blue", "title": "Feature 2", "author": "Your Name Here"}}, {"geometry": {"type": "Point", "coordinates": [62.578125, -53.4375]}, "type": "Feature", "id": 569, "properties": {"strokeColor": "red", "title": "Feature 3", "author": "Your Name Here"}}, {"geometry": {"type": "Point", "coordinates": [121.640625, 16.875]}, "type": "Feature", "id": 568, "properties": {"strokeColor": "red", "title": "Feature 6", "author": "Your Name Here"}}, {"geometry": {"type": "Point", "coordinates": [135.703125, 8.4375]}, "type": "Feature", "id": 567, "properties": {"strokeColor": "red", "title": "Feature 4", "author": "Your Name Here"}}, {"geometry": {"type": "Point", "coordinates": [137.109375, 48.515625]}, "type": "Feature", "id": 566, "properties": {"strokeColor": "red", "title": "Feature 274", "author": "Your Name Here"}}, {"geometry": {"type": "Point", "coordinates": [0, 5]}, "type": "Feature", "id": 565, "properties": {}}, {"geometry": {"type": "Point", "coordinates": [0, 5]}, "type": "Feature", "id": 564, "properties": {}}, {"geometry": {"type": "Point", "coordinates": [0, 5]}, "type": "Feature", "id": 563, "properties": {}}, {"geometry": {"type": "Polygon", "coordinates": [[[-131.484375, -5.9765625], [-112.5, -58.0078125], [-32.34375, -50.2734375], [-114.609375, 52.3828125], [-167.34375, -35.5078125], [-146.953125, -57.3046875], [-139.921875, -34.1015625], [-131.484375, -5.9765625]]]}, "type": "Feature", "id": 562, "properties": {"strokeColor": "red", "title": "Feature 2", "author": "Your Name Here"}}, {"geometry": {"type": "Point", "coordinates": [48.8671875, -15.8203125]}, "type": "Feature", "id": 560, "properties": {"strokeColor": "red", "title": "Feature 2", "author": "Your Name Here"}}, {"geometry": {"type": "LineString", "coordinates": [[-27.0703125, 59.4140625], [-77.6953125, 20.7421875], [30.5859375, -36.2109375], [67.1484375, 34.8046875]]}, "type": "Feature", "id": 559, "properties": {"strokeColor": "red", "title": "Feature 1", "author": "Your Name Here"}}, {"geometry": {"type": "Point", "coordinates": [12.65625, 16.5234375]}, "type": "Feature", "id": 558, "properties": {"styleUrl": "#allstyle", "title": "Feature 1", "strokeColor": "red", "author": "Your Name Here"}}]}';8 var line_feature = '{"type": "FeatureCollection", "features": [{"geometry": {"type": "LineString", "coordinates": [[-27.0703125, 59.4140625], [-77.6953125, 20.7421875], [30.5859375, -36.2109375], [67.1484375, 34.8046875]]}, "type": "Feature", "id": 559, "properties": {"strokeColor": "red", "title": "Feature 1", "author": "Your Name Here"}}]}'; 9 var multiple_features = '{"type": "FeatureCollection", "features": [{"geometry": {"type": "Point", "coordinates": [-91.0546875, 43.9453125]}, "type": "Feature", "id": 577, "properties": {"strokeColor": "red", "title": "Feature 2", "image": "foo.gif", "author": "Your Name Here"}}, {"geometry": {"type": "LineString", "coordinates": [[91.40625, -1.40625], [116.015625, -42.890625], [153.28125, -28.125], [108.984375, 11.25], [75.234375, 8.4375], [76.640625, 9.140625], [67.5, -36.5625], [67.5, -35.859375]]}, "type": "Feature", "id": 576, "properties": {"strokeColor": "red", "title": "Feature 1", "author": "Your Name Here"}}, {"geometry": {"type": "Point", "coordinates": [139.5703125, 57.48046875]}, "type": "Feature", "id": 575, "properties": {"strokeColor": "blue", "title": "Feature 7", "author": "Your Name Here"}}, {"geometry": {"type": "Point", "coordinates": [107.2265625, 82.44140625]}, "type": "Feature", "id": 574, "properties": {"strokeColor": "blue", "title": "Feature 6", "author": "Your Name Here"}}, {"geometry": {"type": "Point", "coordinates": [94.21875, 72.94921875]}, "type": "Feature", "id": 573, "properties": {"strokeColor": "blue", "title": "Feature 5", "author": "Your Name Here"}}, {"geometry": {"type": "Point", "coordinates": [116.3671875, 61.69921875]}, "type": "Feature", "id": 572, "properties": {"strokeColor": "blue", "title": "Feature 4", "author": "Your Name Here"}}, {"geometry": {"type": "Point", "coordinates": [145.8984375, 73.65234375]}, "type": "Feature", "id": 571, "properties": {"strokeColor": "blue", "title": "Feature 3", "author": "Your Name Here"}}, {"geometry": {"type": "Polygon", "coordinates": [[[32.34375, 52.20703125], [87.1875, 70.13671875], [122.6953125, 37.44140625], [75.234375, 42.36328125], [40.078125, 42.36328125], [28.828125, 48.33984375], [18.6328125, 56.77734375], [23.203125, 65.56640625], [32.34375, 52.20703125]]]}, "type": "Feature", "id": 570, "properties": {"strokeColor": "blue", "title": "Feature 2", "author": "Your Name Here"}}, {"geometry": {"type": "Point", "coordinates": [62.578125, -53.4375]}, "type": "Feature", "id": 569, "properties": {"strokeColor": "red", "title": "Feature 3", "author": "Your Name Here"}}, {"geometry": {"type": "Point", "coordinates": [121.640625, 16.875]}, "type": "Feature", "id": 568, "properties": {"strokeColor": "red", "title": "Feature 6", "author": "Your Name Here"}}, {"geometry": {"type": "Point", "coordinates": [135.703125, 8.4375]}, "type": "Feature", "id": 567, "properties": {"strokeColor": "red", "title": "Feature 4", "author": "Your Name Here"}}, {"geometry": {"type": "Point", "coordinates": [137.109375, 48.515625]}, "type": "Feature", "id": 566, "properties": {"strokeColor": "red", "title": "Feature 274", "author": "Your Name Here"}}, {"geometry": {"type": "Point", "coordinates": [0, 5]}, "type": "Feature", "id": 565, "properties": {}}, {"geometry": {"type": "Point", "coordinates": [0, 5]}, "type": "Feature", "id": 564, "properties": {}}, {"geometry": {"type": "Point", "coordinates": [0, 5]}, "type": "Feature", "id": 563, "properties": {}}, {"geometry": {"type": "Polygon", "coordinates": [[[-131.484375, -5.9765625], [-112.5, -58.0078125], [-32.34375, -50.2734375], [-114.609375, 52.3828125], [-167.34375, -35.5078125], [-146.953125, -57.3046875], [-139.921875, -34.1015625], [-131.484375, -5.9765625]]]}, "type": "Feature", "id": 562, "properties": {"strokeColor": "red", "title": "Feature 2", "author": "Your Name Here"}}, {"geometry": {"type": "Point", "coordinates": [48.8671875, -15.8203125]}, "type": "Feature", "id": 560, "properties": {"strokeColor": "red", "title": "Feature 2", "author": "Your Name Here"}}, {"geometry": {"type": "LineString", "coordinates": [[-27.0703125, 59.4140625], [-77.6953125, 20.7421875], [30.5859375, -36.2109375], [67.1484375, 34.8046875]]}, "type": "Feature", "id": 559, "properties": {"strokeColor": "red", "title": "Feature 1", "author": "Your Name Here"}}, {"geometry": {"type": "Point", "coordinates": [12.65625, 16.5234375]}, "type": "Feature", "id": 558, "properties": {"styleUrl": "#allstyle", "title": "Feature 1", "strokeColor": "red", "author": "Your Name Here"}}]}'; 10 10 var parser = new OpenLayers.Format.GeoJSON(); 11 11 … … 146 146 var geomcol = { 147 147 "type": "GeometryCollection", 148 " members": [148 "geometries": [ 149 149 { 150 150 "type": "Point", … … 190 190 var line_object = { 191 191 "type": "FeatureCollection", 192 " members": [192 "features": [ 193 193 { 194 194 "geometry": { … … 213 213 data = parser.read(line_object); 214 214 out = parser.write(data); 215 serialized = '{"type":"FeatureCollection"," members":[{"type":"Feature","id":559,"properties":{"strokeColor":"red","title":"Feature 1","author":"Your Name Here"},"geometry":{"type":"LineString","coordinates":[[-27.0703125,59.4140625],[-77.6953125,20.7421875],[30.5859375,-36.2109375],[67.1484375,34.8046875]]}}]}';215 serialized = '{"type":"FeatureCollection","features":[{"type":"Feature","id":559,"properties":{"strokeColor":"red","title":"Feature 1","author":"Your Name Here"},"geometry":{"type":"LineString","coordinates":[[-27.0703125,59.4140625],[-77.6953125,20.7421875],[30.5859375,-36.2109375],[67.1484375,34.8046875]]}}]}'; 216 216 t.eq(out, serialized, "input and output on line collections are the same"); 217 217 … … 254 254 multipolygon = new OpenLayers.Geometry.MultiPolygon([serialize_tests[4][0], serialize_tests[4][0]]); 255 255 serialize_tests.push([multipolygon, '{"type":"MultiPolygon","coordinates":[[[[1,2],[3,4],[5,6],[1,2]]],[[[1,2],[3,4],[5,6],[1,2]]]]}']); 256 serialize_tests.push([ [ serialize_tests[0][0] ], '{"type":"FeatureCollection"," members":[{"type":"Feature","id":0,"properties":{},"geometry":{"type":"Point","coordinates":[1,2]}}]}' ]);257 serialize_tests.push([ [ serialize_tests[1][0], serialize_tests[2][0] ], '{"type":"GeometryCollection"," members":[{"type":"Point","coordinates":[1,2]},{"type":"MultiPoint","coordinates":[[1,2]]}]}' ]);256 serialize_tests.push([ [ serialize_tests[0][0] ], '{"type":"FeatureCollection","features":[{"type":"Feature","id":0,"properties":{},"geometry":{"type":"Point","coordinates":[1,2]}}]}' ]); 257 serialize_tests.push([ [ serialize_tests[1][0], serialize_tests[2][0] ], '{"type":"GeometryCollection","geometries":[{"type":"Point","coordinates":[1,2]},{"type":"MultiPoint","coordinates":[[1,2]]}]}' ]); 258 258 for (var i = 0; i < serialize_tests.length; i++) { 259 259 var input = serialize_tests[i][0]; … … 269 269 var line_object = { 270 270 "type": "FeatureCollection", 271 " members": [271 "features": [ 272 272 { 273 273 "geometry": { branches/openlayers/2.5/tests/Format/test_GeoRSS.html
r4305 r4794 27 27 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'); 28 28 } 29 function test_Format_GeoRSS_w3cgeo(t) { 30 t.plan(2); 31 32 var parser = new OpenLayers.Format.GeoRSS(); 33 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:lat></item></rss>'); 34 t.eq(data[0].geometry.x, -1, "w3c geo x read correctly"); 35 t.eq(data[0].geometry.y, 1, "w3c geo y read correctly"); 36 } 29 37 function test_Format_GeoRSS_roundtrip(t) { 30 38 t.plan(input.length); branches/openlayers/2.5/tests/Layer/test_MapServer.html
r4299 r4794 400 400 401 401 } 402 403 // DEPRECATED -- REMOVE IN 3.0 404 function test_Layer_Untiled_MapServer(t) { 405 t.plan(1); 406 407 var layer = new OpenLayers.Layer.MapServer.Untiled(); 408 409 var clone = layer.clone(); 410 411 t.ok(clone.singleTile, "regression test: clone works. this is for #1013"); 412 } 402 413 403 414 function test_99_Layer_MapServer_Untiled_destroy (t) { branches/openlayers/2.5/tests/Layer/test_TMS.html
r4390 r4794 120 120 function test_10_Layer_TMS_getURL(t) { 121 121 122 t.plan( 2);122 t.plan(3); 123 123 124 124 var map = new OpenLayers.Map('map', options); … … 129 129 var tileurl = layer.getURL(new OpenLayers.Bounds(3.515625,45,4.21875,45.703125)); 130 130 t.eq(tileurl, "http://labs.metacarta.com/wms-c/Basic.py/1.0.0/basic/9/261/192.png", "Tile URL is correct"); 131 132 var layer2 = layer.clone(); 133 layer2.serviceVersion = "1.2.3"; 134 map.addLayer(layer2); 135 tileurl = layer2.getURL(new OpenLayers.Bounds(3.515625,45,4.21875,45.703125)); 136 t.eq(tileurl, "http://labs.metacarta.com/wms-c/Basic.py/1.2.3/basic/9/261/192.png", "TMS serviceVersion is correct"); 131 137 132 138 layer.url = ["http://tilecache1/", "http://tilecache2/", "http://tilecache3/"]; branches/openlayers/2.5/tests/Layer/test_WMS.html
r4299 r4794 353 353 354 354 } 355 356 // DEPRECATED -- REMOVE IN 3.0 357 function test_Layer_Untiled_WMS(t) { 358 t.plan(1); 359 360 var layer = new OpenLayers.Layer.WMS.Untiled(); 361 362 var clone = layer.clone(); 363 364 t.ok(clone.singleTile, "regression test: clone works. this is for #1013"); 365 } 355 366 356 367 function test_99_Layer_WMS_destroy (t) { branches/openlayers/2.5/tests/test_Util.html
r4302 r4794 19 19 OpenLayers.Util.removeItem(array, 3); 20 20 t.eq( array.toString(), "1,2,4,5", "Util.removeItem works"); 21 } 22 23 function test_03_Util_pagePosition(t) { 24 t.plan( 1 ); 25 var pp = OpenLayers.Util.pagePosition(window); 26 t.eq( pp.toString(), "0,0", "Page position doesn't bail if passed 'window'") 27 21 28 } 22 29
