OpenLayers OpenLayers

Changeset 5857

Show
Ignore:
Timestamp:
01/23/08 17:57:47 (1 year ago)
Author:
tschaub
Message:

merge r5692:HEAD from trunk

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • sandbox/tschaub/wmc/doc/authors.txt

    r5415 r5857  
    1111Pierre Giraud 
    1212Andreas Hocevar 
     13Ian Johnson 
    1314Eric Lemoine 
    1415Philip Lindsay 
  • sandbox/tschaub/wmc/examples/vector-features.html

    r5362 r5857  
    3838            var style_green = { 
    3939                strokeColor: "#00FF00", 
    40                 strokeOpacity: 1, 
    4140                strokeWidth: 3, 
    4241                pointRadius: 6, 
  • sandbox/tschaub/wmc/lib/OpenLayers.js

    r5616 r5857  
    118118            "OpenLayers/Handler.js", 
    119119            "OpenLayers/Handler/Click.js", 
     120            "OpenLayers/Handler/Hover.js", 
    120121            "OpenLayers/Handler/Point.js", 
    121122            "OpenLayers/Handler/Path.js", 
     
    165166            "OpenLayers/Renderer/VML.js", 
    166167            "OpenLayers/Layer/Vector.js", 
     168            "OpenLayers/Layer/PointTrack.js", 
    167169            "OpenLayers/Layer/GML.js", 
    168170            "OpenLayers/Style.js", 
  • sandbox/tschaub/wmc/lib/OpenLayers/Control/ArgParser.js

    r5616 r5857  
    1 /* Cpyright (c) 2006-2008 MetaCarta, Inc., published under the Clear BSD 
     1/* Copyright (c) 2006-2008 MetaCarta, Inc., published under the Clear BSD 
    22 * license.  See http://svn.openlayers.org/trunk/openlayers/license.txt for the 
    33 * full text of the license. */ 
  • sandbox/tschaub/wmc/lib/OpenLayers/Control/ZoomBox.js

    r5616 r5857  
    2222 
    2323    /** 
     24     * Property: out 
     25     * {Boolean} Should the control be used for zooming out? 
     26     */ 
     27    out: false, 
     28 
     29    /** 
    2430     * Method: draw 
    2531     */     
     
    3743    zoomBox: function (position) { 
    3844        if (position instanceof OpenLayers.Bounds) { 
    39             var minXY = this.map.getLonLatFromPixel( 
     45            if (!this.out) { 
     46                var minXY = this.map.getLonLatFromPixel( 
    4047                            new OpenLayers.Pixel(position.left, position.bottom)); 
    41             var maxXY = this.map.getLonLatFromPixel( 
     48                var maxXY = this.map.getLonLatFromPixel( 
    4249                            new OpenLayers.Pixel(position.right, position.top)); 
    43             var bounds = new OpenLayers.Bounds(minXY.lon, minXY.lat, 
     50                var bounds = new OpenLayers.Bounds(minXY.lon, minXY.lat, 
    4451                                               maxXY.lon, maxXY.lat); 
     52            } else { 
     53                var pixWidth = Math.abs(position.right-position.left); 
     54                var pixHeight = Math.abs(position.top-position.bottom); 
     55                var zoomFactor = Math.min((this.map.size.h / pixHeight), 
     56                    (this.map.size.w / pixWidth)); 
     57                var extent = map.getExtent(); 
     58                var center = this.map.getLonLatFromPixel( 
     59                    position.getCenterPixel()); 
     60                var xmin = center.lon - (extent.getWidth()/2)*zoomFactor; 
     61                var xmax = center.lon + (extent.getWidth()/2)*zoomFactor; 
     62                var ymin = center.lat - (extent.getHeight()/2)*zoomFactor; 
     63                var ymax = center.lat + (extent.getHeight()/2)*zoomFactor; 
     64                var bounds = new OpenLayers.Bounds(xmin, ymin, xmax, ymax); 
     65            } 
    4566            this.map.zoomToExtent(bounds); 
    4667        } else { // it's a pixel 
    47             this.map.setCenter(this.map.getLonLatFromPixel(position), 
     68            if (!this.out) { 
     69                this.map.setCenter(this.map.getLonLatFromPixel(position), 
    4870                               this.map.getZoom() + 1); 
     71            } else { 
     72                this.map.setCenter(this.map.getLonLatFromPixel(position), 
     73                               this.map.getZoom() - 1); 
     74            } 
    4975        } 
    5076    }, 
  • sandbox/tschaub/wmc/lib/OpenLayers/Format/GeoRSS.js

    r5616 r5857  
    156156        } 
    157157         
    158         if (this.internalProjection && this.externalProjection) { 
     158        if (geometry && this.internalProjection && this.externalProjection) { 
    159159            geometry.transform(this.externalProjection,  
    160160                               this.internalProjection); 
  • sandbox/tschaub/wmc/lib/OpenLayers/Handler/Click.js

    r5692 r5857  
    172172    /** 
    173173     * Method: passesTolerance 
    174      * Determine whether the event is within the optional pixel tolerance. 
     174     * Determine whether the event is within the optional pixel tolerance.  Note 
     175     *     that the pixel tolerance check only works if mousedown events get to 
     176     *     the listeners registered here.  If they are stopped by other elements, 
     177     *     the <pixelTolerance> will have no effect here (this method will always 
     178     *     return true). 
    175179     * 
    176180     * Returns: 
     
    179183    passesTolerance: function(evt) { 
    180184        var passes = true; 
    181         if(this.pixelTolerance) { 
     185        if(this.pixelTolerance && this.down) { 
    182186            var dpx = Math.sqrt( 
    183187                Math.pow(this.down.x - evt.xy.x, 2) + 
  • sandbox/tschaub/wmc/lib/OpenLayers/Handler/Drag.js

    r5616 r5857  
    3737    started: false, 
    3838     
     39    /** 
     40     * Property: stopDown 
     41     * {Boolean} Stop propagation of mousedown events from getting to listeners 
     42     *     on the same element.  Default is true. 
     43     */ 
     44    stopDown: true, 
     45 
    3946    /**  
    4047     * Property: dragging  
     
    165172            } 
    166173             
    167             propagate = false
     174            propagate = !this.stopDown
    168175        } else { 
    169176            this.started = false; 
  • sandbox/tschaub/wmc/lib/OpenLayers/Layer.js

    r5616 r5857  
    625625        } 
    626626 
     627        // Do not use the scales/resolutions at the map level if 
     628        // minScale/minResolution and maxScale/maxResolution are 
     629        // specified at the layer level 
     630        if (this.options.minScale != null && 
     631            this.options.maxScale != null && 
     632            this.options.scales == null) { 
     633            confProps.scales = null; 
     634        } 
     635        if (this.options.minResolution != null && 
     636            this.options.maxResolution != null && 
     637            this.options.resolutions == null) { 
     638            confProps.resolutions = null; 
     639        } 
     640 
    627641        // If numZoomLevels hasn't been set and the maxZoomLevel *has*,  
    628642        //  then use maxZoomLevel to calculate numZoomLevels 
  • sandbox/tschaub/wmc/lib/OpenLayers/Layer/GML.js

    r5616 r5857  
    2929      */ 
    3030    format: null, 
     31 
     32    /** 
     33     * APIProperty: formatOptions 
     34     * {Object} Hash of options which should be passed to the format when it is 
     35     * created. Must be passed in the constructor. 
     36     */ 
     37    formatOptions: null,  
    3138     
    3239    /** 
     
    98105        }     
    99106    },     
    100          
     107     
     108    /** 
     109     * Method: setUrl 
     110     * Change the URL and reload the GML 
     111     * 
     112     * Parameters: 
     113     * url - {String} URL of a GML file. 
     114     */ 
     115    setUrl:function(url) { 
     116        this.url = url; 
     117        this.destroyFeatures(); 
     118        this.loaded = false; 
     119        this.events.triggerEvent("loadstart"); 
     120        this.loadGML(); 
     121    }, 
    101122     
    102123    /** 
     
    114135            doc = request.responseText; 
    115136        } 
    116  
    117         var gml = this.format ? new this.format() : new OpenLayers.Format.GML(); 
     137         
     138        var options = {}; 
     139         
     140        OpenLayers.Util.extend(options, this.formatOptions); 
     141        if (this.map && !this.projection.equals(this.map.getProjectionObject())) { 
     142            options.externalProjection = this.projection; 
     143            options.internalProjection = this.map.getProjectionObject(); 
     144        }     
     145         
     146        var gml = this.format ? new this.format(options) : new OpenLayers.Format.GML(options); 
    118147        this.addFeatures(gml.read(doc)); 
    119148        this.events.triggerEvent("loadend"); 
  • sandbox/tschaub/wmc/lib/OpenLayers/Layer/GeoRSS.js

    r5616 r5857  
    3030     */ 
    3131    features: null, 
     32     
     33    /** 
     34     * APIProperty: formatOptions 
     35     * {Object} Hash of options which should be passed to the format when it is 
     36     * created. Must be passed in the constructor. 
     37     */ 
     38    formatOptions: null,  
    3239 
    3340    /**  
     
    7077        this.location = location; 
    7178        this.features = []; 
    72         this.events.triggerEvent("loadstart"); 
    73         OpenLayers.loadURL(location, null, this, this.parseData); 
    7479    }, 
    7580 
     
    8792        this.features = null; 
    8893    }, 
     94 
     95    /** 
     96     * Method: loadRSS 
     97     * Start the load of the RSS data. Don't do this when we first add the layer, 
     98     * since we may not be visible at any point, and it would therefore be a waste. 
     99     */ 
     100    loadRSS: function() { 
     101        if (!this.loaded) { 
     102            this.events.triggerEvent("loadstart"); 
     103            OpenLayers.loadURL(this.location, null, this, this.parseData); 
     104            this.loaded = true; 
     105        }     
     106    },     
     107     
     108    /** 
     109     * Method: moveTo 
     110     * If layer is visible and RSS has not been loaded, load RSS.  
     111     *  
     112     * Parameters: 
     113     * bounds - {Object}  
     114     * zoomChanged - {Object}  
     115     * minor - {Object}  
     116     */ 
     117    moveTo:function(bounds, zoomChanged, minor) { 
     118        OpenLayers.Layer.Markers.prototype.moveTo.apply(this, arguments); 
     119        if(this.visibility && !this.loaded){ 
     120            this.events.triggerEvent("loadstart"); 
     121            this.loadRSS(); 
     122        } 
     123    }, 
    89124         
    90125    /** 
     
    114149        } 
    115150        
    116         var format = new OpenLayers.Format.GeoRSS(); 
     151        var options = {}; 
     152         
     153        OpenLayers.Util.extend(options, this.formatOptions); 
     154         
     155        if (this.map && !this.projection.equals(this.map.getProjectionObject())) { 
     156            options.externalProjection = this.projection; 
     157            options.internalProjection = this.map.getProjectionObject(); 
     158        }     
     159         
     160        var format = new OpenLayers.Format.GeoRSS(options); 
    117161        var features = format.read(doc); 
    118162         
     
    120164            var data = {}; 
    121165            var feature = features[i]; 
     166             
     167            // we don't support features with no geometry in the GeoRSS 
     168            // layer at this time.  
     169            if (!feature.geometry) { 
     170                continue; 
     171            }     
     172             
    122173            var title = feature.attributes.title ?  
    123174                         feature.attributes.title : "Untitled"; 
  • sandbox/tschaub/wmc/lib/OpenLayers/Layer/SphericalMercator.js

    r5553 r5857  
    129129     
    130130    /** 
    131      * Method: projectForward  
     131     * Method: projectInverse 
    132132     * Given an object with x and y properties in Spherical Mercator, modify 
    133133     * the x,y properties on the object to be the unprojected coordinates. 
  • sandbox/tschaub/wmc/lib/OpenLayers/Layer/Text.js

    r5616 r5857  
    5454     */ 
    5555    features: null, 
     56     
     57    /** 
     58     * APIProperty: formatOptions 
     59     * {Object} Hash of options which should be passed to the format when it is 
     60     * created. Must be passed in the constructor. 
     61     */ 
     62    formatOptions: null,  
    5663 
    5764    /**  
     
    7380        OpenLayers.Layer.Markers.prototype.initialize.apply(this, arguments); 
    7481        this.features = new Array(); 
    75         if (this.location != null) { 
    76  
    77             var onFail = function(e) { 
    78                 this.events.triggerEvent("loadend"); 
    79             }; 
    80  
    81             this.events.triggerEvent("loadstart"); 
    82             OpenLayers.loadURL(this.location, null,  
    83                                this, this.parseData, onFail); 
    84         } 
    8582    }, 
    8683 
     
    9996    }, 
    10097     
     98    /** 
     99     * Method: loadText 
     100     * Start the load of the Text data. Don't do this when we first add the layer, 
     101     * since we may not be visible at any point, and it would therefore be a waste. 
     102     */ 
     103    loadText: function() { 
     104        if (!this.loaded) { 
     105            if (this.location != null) { 
     106 
     107                var onFail = function(e) { 
     108                    this.events.triggerEvent("loadend"); 
     109                }; 
     110 
     111                this.events.triggerEvent("loadstart"); 
     112                OpenLayers.loadURL(this.location, null,  
     113                                   this, this.parseData, onFail); 
     114                this.loaded = true; 
     115            } 
     116        }     
     117    },     
     118     
     119    /** 
     120     * Method: moveTo 
     121     * If layer is visible and Text has not been loaded, load Text.  
     122     *  
     123     * Parameters: 
     124     * bounds - {Object}  
     125     * zoomChanged - {Object}  
     126     * minor - {Object}  
     127     */ 
     128    moveTo:function(bounds, zoomChanged, minor) { 
     129        OpenLayers.Layer.Markers.prototype.moveTo.apply(this, arguments); 
     130        if(this.visibility && !this.loaded){ 
     131            this.events.triggerEvent("loadstart"); 
     132            this.loadText(); 
     133        } 
     134    }, 
    101135     
    102136    /** 
     
    108142    parseData: function(ajaxRequest) { 
    109143        var text = ajaxRequest.responseText; 
    110         var parser = new OpenLayers.Format.Text(); 
     144         
     145        var options = {}; 
     146         
     147        OpenLayers.Util.extend(options, this.formatOptions); 
     148         
     149        if (this.map && !this.projection.equals(this.map.getProjectionObject())) { 
     150            options.externalProjection = this.projection; 
     151            options.internalProjection = this.map.getProjectionObject(); 
     152        }     
     153         
     154        var parser = new OpenLayers.Format.Text(options); 
    111155        features = parser.read(text); 
    112156        for (var i = 0; i < features.length; i++) { 
  • sandbox/tschaub/wmc/lib/OpenLayers/Layer/TileCache.js

    r5616 r5857  
    104104        var bbox = this.maxExtent; 
    105105        var size = this.tileSize; 
    106         var tileX = Math.floor((bounds.left - bbox.left) / (res * size.w)); 
    107         var tileY = Math.floor((bounds.bottom - bbox.bottom) / (res * size.h)); 
     106        var tileX = Math.round((bounds.left - bbox.left) / (res * size.w)); 
     107        var tileY = Math.round((bounds.bottom - bbox.bottom) / (res * size.h)); 
    108108        var tileZ = this.map.zoom; 
    109109        /** 
  • sandbox/tschaub/wmc/lib/OpenLayers/Layer/WFS.js

    r5616 r5857  
    5454     */ 
    5555    featureClass: null, 
     56     
     57    /** 
     58      * APIProperty: format 
     59      * {<OpenLayers.Format>} The format you want the data to be parsed with. 
     60      * Must be passed in the constructor. Should be a class, not an instance. 
     61      */ 
     62    format: null, 
     63 
     64    /**  
     65     * Property: formatObject 
     66     * {<OpenLayers.Format>} Internally created/managed format object, used by 
     67     * the Tile to parse data. 
     68     */ 
     69    formatObject: null, 
     70 
     71    /** 
     72     * APIProperty: formatOptions 
     73     * {Object} Hash of options which should be passed to the format when it is 
     74     * created. Must be passed in the constructor. 
     75     */ 
     76    formatOptions: null,  
    5677 
    5778    /** 
     
    147168        if (this.vectorMode) { 
    148169            OpenLayers.Layer.Vector.prototype.setMap.apply(this, arguments); 
     170             
     171            var options = { 
     172              'extractAttributes': this.extractAttributes 
     173            }; 
     174             
     175            OpenLayers.Util.extend(options, this.formatOptions); 
     176            if (this.map && !this.projection.equals(this.map.getProjectionObject())) { 
     177                options.externalProjection = this.projection; 
     178                options.internalProjection = this.map.getProjectionObject(); 
     179            }     
     180             
     181            this.formatObject = this.format ? new this.format(options) : new OpenLayers.Format.GML(options); 
    149182        } else {     
    150183            OpenLayers.Layer.Markers.prototype.setMap.apply(this, arguments); 
  • sandbox/tschaub/wmc/lib/OpenLayers/Map.js

    r5692 r5857  
    2727    /** 
    2828     * Constant: EVENT_TYPES 
    29      * {Array(String)} supported application event types 
     29     * {Array(String)} Supported application event types.  Register a listener 
     30     *     for a particular event with the following syntax: 
     31     * (code) 
     32     * map.events.register(type, obj, listener); 
     33     * (end) 
     34     * 
     35     * Supported map event types: 
     36     *  - *addlayer* triggered after a layer has been added 
     37     *  - *removelayer* triggered after a layer has been removed 
     38     *  - *changelayer* triggered after a layer name change, order change, or 
     39     *      visibility change (due to resolution thresholds) 
     40     *  - *movestart* triggered after the start of a drag, pan, or zoom 
     41     *  - *move* triggered after each drag, pan, or zoom 
     42     *  - *moveend* triggered after a drag, pan, or zoom completes 
     43     *  - *popupopen* triggered after a popup opens 
     44     *  - *popupclose* triggered after a popup opens 
     45     *  - *addmarker* triggered after a marker has been added 
     46     *  - *removemarker* triggered after a marker has been removed 
     47     *  - *clearmarkers* triggered after markers have been cleared 
     48     *  - *mouseover* triggered after mouseover the map 
     49     *  - *mouseout* triggered after mouseout the map 
     50     *  - *mousemove* triggered after mousemove the map 
     51     *  - *dragstart* triggered after the start of a drag 
     52     *  - *drag* triggered after a drag 
     53     *  - *dragend* triggered after the end of a drag 
     54     *  - *changebaselayer* triggered after the base layer changes 
    3055     */ 
    3156    EVENT_TYPES: [  
  • sandbox/tschaub/wmc/lib/OpenLayers/Projection.js

    r5616 r5857  
    9090     */ 
    9191    equals: function(projection) { 
    92         return this.getCode() == projection.getCode(); 
     92        if (projection && projection.getCode) { 
     93            return this.getCode() == projection.getCode(); 
     94        } else { 
     95            return false; 
     96        }     
    9397    }, 
    9498 
  • sandbox/tschaub/wmc/lib/OpenLayers/Renderer/Elements.js

    r5616 r5857  
    135135            //now actually draw the node, and style it 
    136136            node = this.drawGeometryNode(node, geometry); 
    137             this.root.appendChild(node); 
     137             
     138            // append the node to root (but only if it's new) 
     139            if (node.parentNode != this.root) {  
     140                this.root.appendChild(node);  
     141            } 
    138142            this.postDraw(node); 
    139143        } else { 
  • sandbox/tschaub/wmc/lib/OpenLayers/Renderer/SVG.js

    r5616 r5857  
    337337            node.setAttributeNS(null, "r", radius); 
    338338        } else { 
    339             this.root.removeChild(node); 
     339            if (node.parentNode == this.root) { 
     340                this.root.removeChild(node); 
     341            } 
    340342        }     
    341343             
  • sandbox/tschaub/wmc/lib/OpenLayers/Renderer/VML.js

    r5616 r5857  
    241241                node.appendChild(stroke); 
    242242            } 
    243             stroke.setAttribute("opacity", style.strokeOpacity); 
     243            if (style.strokeOpacity) { 
     244                stroke.setAttribute("opacity", style.strokeOpacity); 
     245            } 
    244246            stroke.setAttribute("endcap", !style.strokeLinecap || style.strokeLinecap == 'butt' ? 'flat' : style.strokeLinecap); 
    245247        } 
  • sandbox/tschaub/wmc/lib/OpenLayers/Tile.js

    r5616 r5857  
    119119        this.events.destroy(); 
    120120        this.events = null; 
     121    }, 
     122     
     123    /** 
     124     * Method: clone 
     125     * 
     126     * Parameters: 
     127     * obj - {<OpenLayers.Tile>} The tile to be cloned 
     128     * 
     129     * Returns: 
     130     * {<OpenLayers.Tile>} An exact clone of this <OpenLayers.Tile> 
     131     */ 
     132    clone: function (obj) { 
     133        if (obj == null) { 
     134            obj = new OpenLayers.Tile(this.layer,  
     135                                      this.position,  
     136                                      this.bounds,  
     137                                      this.url,  
     138                                      this.size); 
     139        }  
     140         
     141        // catch any randomly tagged-on properties 
     142        OpenLayers.Util.applyDefaults(obj, this); 
     143         
     144        return obj; 
    121145    }, 
    122146 
  • sandbox/tschaub/wmc/lib/OpenLayers/Tile/Image.js

    r5616 r5857  
    9393 
    9494    /** 
     95     * Method: clone 
     96     * 
     97     * Parameters: 
     98     * obj - {<OpenLayers.Tile.Image>} The tile to be cloned 
     99     * 
     100     * Returns: 
     101     * {<OpenLayers.Tile.Image>} An exact clone of this <OpenLayers.Tile.Image> 
     102     */ 
     103    clone: function (obj) { 
     104        if (obj == null) { 
     105            obj = new OpenLayers.Tile.Image(this.layer,  
     106                                            this.position,  
     107                                            this.bounds,  
     108                                            this.url,  
     109                                            this.size);         
     110        }  
     111         
     112        //pick up properties from superclass 
     113        obj = OpenLayers.Tile.prototype.clone.apply(this, [obj]); 
     114         
     115        //dont want to directly copy the image div 
     116        obj.imgDiv = null; 
     117             
     118         
     119        return obj; 
     120    }, 
     121     
     122    /** 
    95123     * Method: draw 
    96124     * Check that a tile should be drawn, and draw it. 
     
    146174        if(this.imgDiv) { 
    147175            this.imgDiv.style.display = "none"; 
     176            if (OpenLayers.Tile.Image.useBlankTile) {  
     177                this.imgDiv.src = OpenLayers.Util.getImagesLocation() + "blank.gif"; 
     178            }     
    148179        } 
    149180    }, 
     
    267298  } 
    268299); 
     300 
     301OpenLayers.Tile.Image.useBlankTile = (  
     302    OpenLayers.Util.getBrowserName() == "safari" ||  
     303    OpenLayers.Util.getBrowserName() == "opera");  
  • sandbox/tschaub/wmc/lib/OpenLayers/Tile/WFS.js

    r5616 r5857  
    6868        if(this.request) { 
    6969            this.request.transport.abort(); 
     70            //this.request.destroy(); 
     71            this.request = null; 
    7072        } 
    7173    }, 
     
    109111    */ 
    110112    loadFeaturesForRegion:function(success, failure) { 
     113        if(this.request) { 
     114            this.request.transport.abort(); 
     115            //this.request.destroy(); 
     116        } 
    111117        this.request = OpenLayers.loadURL(this.url, null, this, success); 
    112118    }, 
     
    128134            } 
    129135            if (this.layer.vectorMode) { 
    130                 var gml = new OpenLayers.Format.GML({ 
    131                     'extractAttributes': this.layer.options.extractAttributes 
    132                 }); 
    133                 this.layer.addFeatures(gml.read(doc)); 
     136                this.layer.addFeatures(this.layer.formatObject.read(doc)); 
    134137            } else { 
    135138                var resultFeatures = OpenLayers.Ajax.getElementsByTagNameNS( 
     
    142145            this.events.triggerEvent("loadend");  
    143146        } 
     147 
     148        //request produced with success, we can delete the request object. 
     149        //this.request.destroy(); 
     150        this.request = null; 
    144151    }, 
    145152 
  • sandbox/tschaub/wmc/tests/Format/test_GeoRSS.html

    r5478 r5857  
    3535        t.eq(data[0].geometry.x, -1, "w3c geo x read correctly");  
    3636        t.eq(data[0].geometry.y, 1, "w3c geo y read correctly");  
     37    } 
     38    function test_Format_GeoRSS_reproject_null(t) {  
     39        t.plan(1); 
     40 
     41        var parser = new OpenLayers.Format.GeoRSS({'internalProjection':new OpenLayers.Projection("EPSG:4326"), 'externalProjection': new OpenLayers.Projection("EPSG:4326")}); 
     42        var data = parser.read('<rss xmlns="http://backend.userland.com/rss2" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#"><item></item></rss>'); 
     43        t.eq(data.length, 1, "Parsing items with null geometry and reprojection doesn't fail"); 
    3744    } 
    3845    function test_Format_GeoRSS_roundtrip(t) { 
  • sandbox/tschaub/wmc/tests/Layer/test_GML.html

    r4252 r5857  
    77     
    88    var gml = "./owls.xml"; 
     9    var gml2 = "./mice.xml"; 
    910 
    1011    // if this test is running online, different rules apply 
     
    1213    if (isMSIE) { 
    1314        gml = "." + gml; 
     15        gml2 = "." + gml2; 
    1416    } 
    1517     
     
    4143 
    4244    } 
     45    function test_GML_setUrl(t) { 
     46        t.plan(2); 
     47        var layer = new OpenLayers.Layer.GML(name, gml); 
     48        var map = new OpenLayers.Map("map"); 
     49        map.addLayer(layer); 
     50        t.eq(layer.url, gml, "layer has correct original url"); 
     51        layer.setUrl(gml2); 
     52        t.eq(layer.url, gml2, "layer has correctly changed url"); 
     53    } 
    4354  </script> 
    4455</head> 
  • sandbox/tschaub/wmc/tests/Layer/test_GeoRSS.html

    r4356 r5857  
    2222        t.eq( layer.location, georss_txt, "layer.location is correct" ); 
    2323        var markers; 
     24        layer.loadRSS(); 
    2425        t.delay_call( 1, function() {   
    2526            t.eq( layer.markers.length, 40, "marker length is correct" ); 
     
    4445        t.eq( layer.location, atom_xml, "layer.location is correct" ); 
    4546        var markers; 
     47        layer.loadRSS(); 
    4648        t.delay_call( 1, function() {   
    4749            t.eq( layer.markers.length, 2, "marker length is correct" ); 
     
    154156        map.setCenter(new OpenLayers.LonLat(0,0),0); 
    155157        var defaultIcon = OpenLayers.Marker.defaultIcon(); 
    156         t.delay_call( 1, function() { 
     158        layer.loadRSS(); 
     159        otherLayer.loadRSS(); 
     160        t.delay_call( 2, function() { 
    157161            t.ok(layer.markers[0].icon, "The layer has a icon"); 
    158162            t.eq(layer.markers[0].icon.url, defaultIcon.url, "The layer without icon has the default icon."); 
  • sandbox/tschaub/wmc/tests/Layer/test_Text.html

    r5489 r5857  
    2222         
    2323        layer = new OpenLayers.Layer.Text('Test Layer', { location: datafile }); 
     24        layer.loadText(); 
    2425        t.ok( layer instanceof OpenLayers.Layer.Text, "new OpenLayers.Layer.Text returns object" ); 
    2526        t.eq( layer.location, datafile, "layer.location is correct" ); 
  • sandbox/tschaub/wmc/tests/Layer/test_WFS.html

    r5462 r5857  
    66    var name = "Vector Layer"; 
    77     
    8     function test_01_Layer_WFS_constructor(t) { 
     8    function test_Layer_WFS_constructor(t) { 
    99        t.plan(3); 
    1010 
     
    1515 
    1616    } 
    17     function test_02_Layer_WFS_mapresizevector(t) { 
     17    function test_Layer_WFS_mapresizevector(t) { 
    1818        t.plan(2); 
    1919 
  • sandbox/tschaub/wmc/tests/Renderer/test_SVG.html