OpenLayers OpenLayers

Changeset 4794

Show
Ignore:
Timestamp:
10/03/07 16:27:15 (1 year ago)
Author:
crschmidt
Message:

Pull up most of the changes for what will be 2.5RC4:

  • Clone on WMS/MS Untiled, 4760:4761 (Closes #1013)
  • serviceVersion on TMS, 4720:4721 (Closes #1023)
  • W3CGeo in Format.GeoRSS, 4768:4769, 4778:4779 (Closes #1024)
  • GeoJSON Draft4 Update, 4769:4770 (Closes #1028)
  • pagePosition Regression 4782:4783, (Closes #1034)
  • example changes 4691:4692 (Closes #1040)
  • WFS missing registerTileListener 4759:4760 (Closes #1045)
  • Yahoo API to stop dragging 4792:4793 (Closes #1052)
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/openlayers/2.5/examples/spherical-mercator.html

    r4260 r4794  
    100100             
    101101            map.addLayers([gmap, gsat, ghyb, veroad, veaer, vehyb, 
    102                            yahoo, yahoosat, yahoohyb, mapnik, wms]); 
     102                           yahoo, yahoosat, yahoohyb, mapnik, wms, vector]); 
    103103            map.addControl(new OpenLayers.Control.LayerSwitcher()); 
    104104            map.addControl(new OpenLayers.Control.EditingToolbar(vector)); 
  • branches/openlayers/2.5/lib/OpenLayers/Format/GeoJSON.js

    r4390 r4794  
    9494                case "GeometryCollection": 
    9595                    results = []; 
    96                     for(var i=0; i<obj.members.length; ++i) { 
     96                    for(var i=0; i<obj.geometries.length; ++i) { 
    9797                        try { 
    98                             results.push(this.parseGeometry(obj.members[i])); 
     98                            results.push(this.parseGeometry(obj.geometries[i])); 
    9999                        } catch(err) { 
    100100                            results = null; 
     
    116116                            break; 
    117117                        case "FeatureCollection": 
    118                             for(var i=0; i<obj.members.length; ++i) { 
     118                            for(var i=0; i<obj.features.length; ++i) { 
    119119                                try { 
    120                                     results.push(this.parseFeature(obj.members[i])); 
     120                                    results.push(this.parseFeature(obj.features[i])); 
    121121                                } catch(err) { 
    122122                                    results = null; 
     
    126126                            break; 
    127127                        case "GeometryCollection": 
    128                             for(var i=0; i<obj.members.length; ++i) { 
     128                            for(var i=0; i<obj.geometries.length; ++i) { 
    129129                                try { 
    130                                     var geom = this.parseGeometry(obj.members[i]); 
     130                                    var geom = this.parseGeometry(obj.geometries[i]); 
    131131                                    results.push(new OpenLayers.Feature.Vector(geom)); 
    132132                                } catch(err) { 
     
    437437        }; 
    438438        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            }     
    440444            for(var i=0; i<obj.length; ++i) { 
    441445                var element = obj[i]; 
     
    444448                        geojson.type = "FeatureCollection"; 
    445449                        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); 
    455451                        } 
    456452                    } else if(geojson.type != "FeatureCollection") { 
     
    458454                        break; 
    459455                    } 
    460                     geojson.members.push(this.extract.feature.apply(this, [element])); 
     456                    geojson.features.push(this.extract.feature.apply(this, [element])); 
    461457                } else if (element.CLASS_NAME.search("OpenLayers.Geometry") == 0) { 
    462458                    if(geojson.type == null) { 
     
    466462                        break; 
    467463                    } 
    468                     geojson.members.push(this.extract.geometry.apply(this, [element])); 
     464                    geojson.geometries.push(this.extract.geometry.apply(this, [element])); 
    469465                } 
    470466            } 
     
    474470            geojson = this.extract.feature.apply(this, [obj]); 
    475471            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); 
    485473            } 
    486474        } 
    487475        return OpenLayers.Format.JSON.prototype.write.apply(this, 
    488476                                                            [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       } 
    489503    }, 
    490504     
  • branches/openlayers/2.5/lib/OpenLayers/Format/GeoRSS.js

    r4390 r4794  
    3939     */ 
    4040    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#", 
    4148     
    4249    /** 
  • branches/openlayers/2.5/lib/OpenLayers/Layer/MapServer/Untiled.js

    r4223 r4794  
    4141    },     
    4242 
     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 
    4367    CLASS_NAME: "OpenLayers.Layer.MapServer.Untiled" 
    4468}); 
  • branches/openlayers/2.5/lib/OpenLayers/Layer/TMS.js

    r4223 r4794  
    1313 */ 
    1414OpenLayers.Layer.TMS = OpenLayers.Class(OpenLayers.Layer.Grid, { 
     15 
     16    /** 
     17     * APIProperty: serviceVersion 
     18     * {String} 
     19     */ 
     20    serviceVersion: "1.0.0", 
    1521 
    1622    /** 
     
    9298        var y = Math.round((bounds.bottom - this.tileOrigin.lat) / (res * this.tileSize.h)); 
    9399        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;  
    95101        var url = this.url; 
    96102        if (url instanceof Array) { 
  • branches/openlayers/2.5/lib/OpenLayers/Layer/WFS.js

    r4318 r4794  
    256256                this.tile = new OpenLayers.Tile.WFS(this, pos, tileBounds,  
    257257                                                     url, tileSize); 
     258                this.addTileMonitoringHooks(this.tile); 
    258259                this.tile.draw(); 
    259260            }  
  • branches/openlayers/2.5/lib/OpenLayers/Layer/WMS/Untiled.js

    r4019 r4794  
    4141    },     
    4242 
     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 
    4367    CLASS_NAME: "OpenLayers.Layer.WMS.Untiled" 
    4468}); 
  • branches/openlayers/2.5/lib/OpenLayers/Layer/Yahoo.js

    r4223 r4794  
    9292            this.mapObject = new YMap(this.div, this.type, size); 
    9393            this.mapObject.disableKeyControls(); 
     94            this.mapObject.disableDragMap(); 
    9495        } catch(e) {} 
    9596    }, 
  • branches/openlayers/2.5/lib/OpenLayers/Util.js

    r4302 r4794  
    992992 
    993993        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') { 
    9951000                break; 
    9961001            } 
  • branches/openlayers/2.5/tests/Format/test_GeoJSON.html

    r4156 r4794  
    44    <script type="text/javascript"> 
    55 
    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"}}]}';  
    77    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"}}]}'; 
    1010    var parser = new OpenLayers.Format.GeoJSON(); 
    1111 
     
    146146       var geomcol = { 
    147147           "type": "GeometryCollection", 
    148            "members": [ 
     148           "geometries": [ 
    149149               { 
    150150                   "type": "Point", 
     
    190190        var line_object = { 
    191191            "type": "FeatureCollection",  
    192             "members": [ 
     192            "features": [ 
    193193                { 
    194194                    "geometry": { 
     
    213213        data = parser.read(line_object); 
    214214        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]]}}]}'; 
    216216        t.eq(out, serialized, "input and output on line collections are the same"); 
    217217         
     
    254254        multipolygon = new OpenLayers.Geometry.MultiPolygon([serialize_tests[4][0],  serialize_tests[4][0]]); 
    255255        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]]}]}' ]); 
    258258        for (var i = 0; i < serialize_tests.length; i++) { 
    259259            var input = serialize_tests[i][0]; 
     
    269269        var line_object = { 
    270270            "type": "FeatureCollection",  
    271             "members": [ 
     271            "features": [ 
    272272                { 
    273273                    "geometry": { 
  • branches/openlayers/2.5/tests/Format/test_GeoRSS.html

    r4305 r4794  
    2727        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'); 
    2828    } 
     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    } 
    2937    function test_Format_GeoRSS_roundtrip(t) { 
    3038        t.plan(input.length); 
  • branches/openlayers/2.5/tests/Layer/test_MapServer.html

    r4299 r4794  
    400400 
    401401    }     
     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    } 
    402413     
    403414    function test_99_Layer_MapServer_Untiled_destroy (t) { 
  • branches/openlayers/2.5/tests/Layer/test_TMS.html

    r4390 r4794  
    120120    function test_10_Layer_TMS_getURL(t) { 
    121121 
    122         t.plan(2); 
     122        t.plan(3); 
    123123         
    124124        var map = new OpenLayers.Map('map', options); 
     
    129129        var tileurl = layer.getURL(new OpenLayers.Bounds(3.515625,45,4.21875,45.703125)); 
    130130        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"); 
    131137 
    132138        layer.url = ["http://tilecache1/", "http://tilecache2/", "http://tilecache3/"]; 
  • branches/openlayers/2.5/tests/Layer/test_WMS.html

    r4299 r4794  
    353353 
    354354    } 
     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    } 
    355366     
    356367    function test_99_Layer_WMS_destroy (t) { 
  • branches/openlayers/2.5/tests/test_Util.html

    r4302 r4794  
    1919        OpenLayers.Util.removeItem(array, 3); 
    2020        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         
    2128    } 
    2229