Changeset 5842 for cowsclient


Ignore:
Timestamp:
14/10/09 11:45:28 (10 years ago)
Author:
pnorton
Message:

Improved the refreshing of the bounds on the wcsdown page, the red selection border should no longer appear when the whole screen is selected. Also modified the wcs download button on the wmsviz page to disable itself when there is no layer selected.

Location:
cowsclient/trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • cowsclient/trunk/cowsclient/public/js/boundingBoxMapSelect.js

    r5818 r5842  
    3030     
    3131    this.events.register('TEXT_SELECTION_CHANGED', this, this._boundsTextChanged); 
    32     this.events.register('clearSelection', this, this._resetMapSelection);             
    33      
     32    this.events.register('clearSelection', this, this._resetMapSelection); 
     33         
    3434}; 
    3535 
     
    8989         
    9090        // move to the default bounds 
    91         this.subselControl.setSubSel(this._bbox); 
     91        this.map.zoomToExtent(this._bbox); 
     92         
     93        // if the extent doesn't fit the old bounds exactly then they must 
     94        // have been selected using the subsel control. 
     95        var extent = this.map.getExtent(); 
     96        var roundedExtent = new OpenLayers.Bounds(extent.left.toFixed(1), extent.bottom.toFixed(1), extent.right.toFixed(1), extent.top.toFixed(1)); 
     97         
     98        if (! roundedExtent.equals(this._bbox)) { 
     99            this.subselControl.setSubSel(this._bbox); 
     100        } 
     101         
     102 
     103//        var c = new OpenLayers.LonLat(136.275, 69.7200); 
     104//        this.map.setCenter(c); 
     105//        this.map.zoomTo(1); 
    92106         
    93107        this.map.events.register('moveend', this, this._mapMoved); 
     
    123137        this.events.triggerEvent('MAP_SELECTION_CHANGED', {selection: this._bbox }); 
    124138        this._updateBBoxString(); 
     139         
     140        var center = this.map.getCenter(); 
     141        var zoom = this.map.getZoom(); 
     142        WMSC.log("Center = " + center + " zoom = " + zoom); 
    125143    }, 
    126144     
  • cowsclient/trunk/cowsclient/public/js/wcs.js

    r5776 r5842  
    22WCSDownloadControl = function (downloadDivId, initailBounds, eventsManager) { 
    33     
     4    this.downloadButton = this.createDownloadButton() 
    45    this.eventsManager = eventsManager; 
    56    this.downloadDiv = document.getElementById(downloadDivId); 
    67    this.currentBounds = initailBounds; 
    78    this.currentLayer = null; 
     9    this._retriever = AjaxRetriever(); 
    810     
    9     this.downloadButton = this.createDownloadButton() 
    1011     
    1112    Utils.addHTMLEventListener(this.downloadButton, 'click', this.setupWCSrequest, this); 
     
    3435    _onSelectedLayerChanged: function (e) { 
    3536        this.currentLayer = e.layer; 
     37         
     38        if (this.currentLayer === null) { 
     39            this.downloadButton.disabled = true; 
     40             
     41        } else { 
     42             
     43            this.downloadButton.disabled = false; 
     44             
     45            WMSC.log("WCS endpoint is now " + this._getWCSEndpoint()); 
     46             
     47//            var wcsGetCapabilities = Utils.replaceParamsInUrl(this._getWCSEndpoint(),  
     48//                                       {Request:'GetCapabilities', Service:'WCS'}); 
     49//             
     50//            WMSC.log("wcsGetCapabilities = " + wcsGetCapabilities); 
     51//             
     52//            var onSuccess = function(xhr, wcsEndpoint) { 
     53//                // check the endpoint hasn't changed 
     54//                if (this._getWCSEndpoint() === wcsEndpoint) { 
     55//                    this.downloadButton.enabled = true; 
     56//                } 
     57//            }; 
     58//             
     59//            var onFail = function(resp, wcsEndpoint) { 
     60//                if (this._getWCSEndpoint() === wcsEndpoint) { 
     61//                    this.downloadButton.enabled = false; 
     62//                } 
     63//            }; 
     64//             
     65//            var onExcept= function (resp, e) { 
     66//                WMSC.log("Exception:" + e);  
     67//            }; 
     68//             
     69//            var params = {REQUEST: 'GetLegend', ENDPOINT: url}; 
     70//             
     71//            var req = new Ajax.Request('',  
     72//                    {method: "get", 
     73//                     params: params, 
     74//                     onSuccess: onSuccess.bindAsEventListener(this, this._getWCSEndpoint()), 
     75//                     onException : onExcept, 
     76//                     onFailure : onFail.bindAsEventListener(this, this._getWCSEndpoint()) 
     77//                    }); 
     78        } 
     79         
     80        return 1; 
    3681    }, 
    3782     
     
    5095        // NB, there are initially three layers - for the subselection box, coastline and base map 
    5196         
    52         var wmsurl = this.currentLayer.getFullRequestString(); 
    53         var urlparts = wmsurl.split('?'); 
    54         var wcsEndpoint=urlparts[0].replace('wms', 'wcs') +'?'; 
     97        var wcsEndpoint = this._getWCSEndpoint(); 
     98         
    5599        var coords=document.getElementById('coordsForm'); 
    56100            
     
    76120        //build url string 
    77121        var wcsurl=wcsEndpoint; 
     122         
    78123        for (param in params) { 
    79124            wcsurl = wcsurl + param + '=' + params[param] + '&'; 
    80125        } 
     126         
    81127        WMSC.log('Making wcs request to ' + wcsurl) 
    82128        window.open(wcsurl, 'download');  
    83129        return false; 
     130    }, 
     131     
     132    _getWCSEndpoint: function() { 
     133        var wmsurl = this.currentLayer.getFullRequestString(); 
     134        var urlparts = wmsurl.split('?'); 
     135        var wcsEndpoint=urlparts[0].replace('wms', 'wcs') +'?'; 
     136        return wcsEndpoint 
    84137    } 
    85      
    86138}; 
    87139 
  • cowsclient/trunk/cowsclient/public/layout/drag_drop_style.css

    r5626 r5842  
    88{  
    99        padding:10px;  
    10         float:left  
     10        /* float:left */  
    1111} 
    1212 
  • cowsclient/trunk/cowsclient/templates/wcsdown.html

    r5818 r5842  
    241241            </form> 
    242242        </div> 
    243          
    244     </div> 
    245      
    246  
    247  
    248      
     243    </div>    
    249244 
    250245</body> 
  • cowsclient/trunk/displayOptions.ini

    r5720 r5842  
    77 
    88[DefaultOptions] 
    9 rules=modis_interval 
     9rules=modis_interval,psc_interval 
    1010 
    1111[DefaultOptions:modis_interval] 
     
    1313layers=igbp_class 
    1414values=intervalColourbar|true 
     15 
     16[DefaultOptions:psc_interval] 
     17endpoint=http://ice.badc.rl.ac.uk:5000/psc[^/]*/wms 
     18layers=.* 
     19values=intervalColourbar|true,intervalNames|Land%%2CNo%%2520Data%%2CPicoplankton%%2CNanoplankton%%2CMicroplankton 
     20 
     21# not need to double quote spaces as well as double up % marks,  
     22# so ' ' -> '%%20' -> '%%2520' 
  • cowsclient/trunk/endpoints.txt

    r5818 r5842  
    11[COWS] 
     2http://ice.badc.rl.ac.uk:5000 
    23 
    34[WMS] 
    4 http://ice.badc.rl.ac.uk:5000/clim_10/wms3 
    5 http://ice.badc.rl.ac.uk:5000/clim_30/wms3 
    6 http://ice.badc.rl.ac.uk:5000/cru_tmc/wms3 
    7 http://ice.badc.rl.ac.uk:5000/ccip/wms3 
    85http://ice.badc.rl.ac.uk:5000/coastwms 
    9 http://ice.badc.rl.ac.uk:5000/globalpop/wms3 
    10 http://ice.badc.rl.ac.uk:5000/modis/wms3 
    11 http://ice.badc.rl.ac.uk:5000/islscp_soil/wms3 
    126http://labs.metacarta.com/wms/vmap0 
    137http://ndg3beta.badc.rl.ac.uk/cows/demo_hadcm3/wms 
    148 
    159[WCS] 
    16 http://ice.badc.rl.ac.uk:5000/clim_10/wcs3 
    17 http://ice.badc.rl.ac.uk:5000/clim_30/wcs3 
    18 http://ice.badc.rl.ac.uk:5000/cru_tmc/wcs3 
    19 http://ice.badc.rl.ac.uk:5000/ccip/wcs3 
     10http://ndg3beta.badc.rl.ac.uk/ccip/HighProjections/wcs 
     11http://ccip.lat-lon.de/ccip-wcs/services 
    2012http://motherlode.ucar.edu:8080/thredds/wcs/fmrc/NCEP/NAM/CONUS_40km/conduit/NCEP-NAM-CONUS_40km-conduit_best.ncd 
    2113 
Note: See TracChangeset for help on using the changeset viewer.