Ignore:
Timestamp:
24/07/09 14:48:42 (11 years ago)
Author:
pnorton
Message:

Modified the behaviour of the layerList so that new items added are automatically selected and added to the start of the list.

Also implemented an attempt at setting up the initial selection via the URL arguments.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cowsclient/branches/qesdi/cowsclient/templates/wmsviz.html

    r5505 r5515  
    108108    legendContainer.addLayerParametersHandlers(layerParameters.events); 
    109109     
    110     <for py:for="i in session['viewItems']" class="dataset" py:strip="True"> 
    111         <span py:if="i.wmcURL" py:strip="True"> 
    112             layerControl.addWebMapContext("${i.wmcURL}"); 
    113         </span> 
    114     </for>  
    115      
    116110    app = new WMSC.VisApp('map', 10, 640, true); 
    117111 
     
    122116    if (document.getElementById('wcsdownload') == null) { 
    123117        //createDownloadButton(wcsdownloadDiv);     
    124         } 
     118    } 
     119 
     120    var initialSetupJSON = "${c.initialSetupJSON}"; 
     121 
     122    var initialEndpoints = JSON.parse(initialSetupJSON); 
     123 
     124    for (var i=0;i&lt;initialEndpoints.length;i++) { 
     125        var endpoint = initialEndpoints[i]; 
     126 
     127        layerControl.addLayersToSelect(endpoint.url, endpoint.layers); 
     128        layerControl.addWebMapContext(endpoint.url); 
     129         
     130    } 
     131 
     132    /* 
     133    if ( initialSetupObj.Layers != undefined) { 
     134        layerControl.addLayersToSelect(initialSetupObj.Layers); 
     135    } 
     136         
     137    if ( initialSetupObj.Endpoints != undefined) { 
     138            for (var i=0;i&lt;initialSetupObj.Endpoints.length;i++){ 
     139                var endpoint = initialSetupObj.Endpoints[i]; 
     140                layerControl.addWebMapContext(endpoint); 
     141            } 
     142    } 
     143    */ 
     144 
    125145     
    126146} 
Note: See TracChangeset for help on using the changeset viewer.