OpenLayers OpenLayers

Ticket #1013: clone.2.patch

File clone.2.patch, 3.5 kB (added by euzuro, 1 year ago)

new patch includes fix and test for deprecated untiled mapserver layer.

  • tests/Layer/test_MapServer.html

    old new  
    399399        t.eq(parseFloat(tLayer.div.firstChild.firstChild.style.opacity), 0.6, "Opacity on tile is changed correctly"); 
    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) { 
    404415 
  • tests/Layer/test_WMS.html

    old new  
    352352        map.destroy(); 
    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) { 
    357368 
  • lib/OpenLayers/Layer/MapServer/Untiled.js

    old new  
    4040        OpenLayers.Console.warn(msg); 
    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}); 
  • lib/OpenLayers/Layer/WMS/Untiled.js

    old new  
    4040        OpenLayers.Console.warn(msg); 
    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});