Changeset 1192

Show
Ignore:
Timestamp:
07/01/09 05:18:43 (4 years ago)
Author:
tschaub
Message:

Same treatment for the branch.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • apps/opengeo/geoexplorer/branches/0.1.x/lib/GeoExplorer.js

    r1187 r1192  
    400400                id = this.capabilities.find("name", conf.name); 
    401401                if(id >= 0) { 
    402                     record = this.capabilities.getAt(id).copy(); 
    403                     layer = record.get("layer"); 
     402                    /** 
     403                     * If the same layer is added twice, it will get replaced 
     404                     * unless we give each record a unique id.  In addition, we 
     405                     * need to clone the layer so that the map doesn't assume 
     406                     * the layer has already been added.  Finally, we can't 
     407                     * simply set the record layer to the cloned layer because 
     408                     * record.set compares String(value) to determine equality. 
     409                     *  
     410                     * TODO: suggest record.clone 
     411                     */ 
     412                    Ext.data.Record.AUTO_ID++; 
     413                    record = this.capabilities.getAt(id).copy(Ext.data.Record.AUTO_ID); 
     414                    layer = record.get("layer").clone(); 
     415                    record.set("layer", null); 
     416                    record.set("layer", layer); 
    404417 
    405418                    // set layer max extent from capabilities