Changeset 5778 for cowsclient


Ignore:
Timestamp:
29/09/09 11:42:48 (10 years ago)
Author:
pnorton
Message:

Fixed the wcsdownload bounding box selection map so that it works with the new bounds control.

Also modified the templates to look for a custom config file value to set the Openlayers.js path, otherwise the compressed one will be used. Hopefully this will stop me committing the code with the wrong path.

Location:
cowsclient/trunk/cowsclient
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • cowsclient/trunk/cowsclient/controllers/wcsdown.py

    r5759 r5778  
    4949        c.singleTimePoint = params.get('SINGLE_TIME', "") 
    5050         
    51         #endpoint = 'http://localhost:5000/clim_10/wcs?' 
    52  
    5351        layers = [] 
    5452        timepositions = None 
     
    5654        if endpoint != None: 
    5755             
     56            st1 = time.time() 
    5857            wcs, layers = self._getWCSObj(endpoint) 
     58            log.debug("retrieved wcs metadata in  = %s" % (time.time() - st1,)) 
    5959             
    6060            if layer != None: 
     61                st1 = time.time() 
    6162                layerMetadata, c.bboxLimits, timepositions, c.supportedFormats, c.supportedCRS =\ 
    6263                       self._getWCSMetadata(wcs, layer) 
     64                log.debug("retrieved layer metadata in  = %s" % (time.time() - st1,)) 
    6365                 
    6466         
  • cowsclient/trunk/cowsclient/controllers/wmsviz.py

    r5709 r5778  
    162162        c.baseLayerJSON = utils.toJSON(baseLayerObj)  
    163163         
    164  
    165164        return render('wmsviz') 
    166165 
  • cowsclient/trunk/cowsclient/public/js/boundingBoxMapSelect.js

    r5759 r5778  
    2121    this._updateBBoxString(); 
    2222     
     23    this.events.register('TEXT_SELECTION_CHANGED', this, this._boundsTextChanged); 
     24    this.events.register('clearSelection', this, this._resetMapSelection);             
     25     
    2326}; 
    2427 
    2528BoundingBoxMapSelect.prototype = { 
    2629 
    27     EVENT_TYPES: ['MAP_SELECTION_CHANGED'],         
     30    EVENT_TYPES: ['MAP_SELECTION_CHANGED', 'TEXT_SELECTION_CHANGED', 'clearSelection'],         
    2831 
    2932    boundsMarkup : '<div id="bbox_sel_bounds_container" class="WMSC_domain">\n' + 
     
    8285     
    8386    _buildBoundsControl: function () { 
    84         this.boundsControl = new WMSC.BoundsControl(this.controlContainerId, this._bbox, this.boundsMarkup) 
    85         this.boundsControl.events.register('TEXT_SELECTION_CHANGED', this, this._boundsTextChanged); 
    86         this.boundsControl.events.register('clearSelection', this, this._resetMapSelection);         
    87         this.boundsControl.addMapSelectionChanged(this.events); 
     87        this.boundsControl = new WMSC.BoundsControl(this.controlContainerId, this._bbox, this.events, this.boundsMarkup); 
    8888    }, 
    8989     
  • cowsclient/trunk/cowsclient/templates/wcsdown.html

    r5759 r5778  
    55 
    66<?python 
    7 def setAtt(dict, name, value): 
    8     if value != None: 
    9         dict[name] = value 
     7 
     8    from pylons import config 
     9    openlayersImportPath = config.get('openlayers_js_path', config['serverurl'] + '/js/OpenLayers.js') 
     10 
     11 
     12    def setAtt(dict, name, value): 
     13        if value != None: 
     14            dict[name] = value 
    1015     
    1116?> 
     
    8590<!-- End of autocomplete imports --> 
    8691 
    87 <script type="text/javascript" src="$g.server/js/openlayers/lib/OpenLayers.js" /> 
     92<script type="text/javascript" src="${openlayersImportPath}" /> 
    8893<script type="text/javascript" src="$g.server/js/openlayers-x.js" /> 
    8994 
  • cowsclient/trunk/cowsclient/templates/wmsviz.html

    r5777 r5778  
    77 
    88<?python 
     9 
     10    from pylons import config 
     11    openlayersImportPath = config.get('openlayers_js_path', config['serverurl'] + '/js/OpenLayers.js') 
     12 
    913    def jsonParseIfNotEmpty(var): 
    1014        if var is not None and var != "": 
     
    6872<script type="text/javascript" src="$g.server/js/wmsc.js"></script> 
    6973<script type="text/javascript" src="$g.server/js/prototype.js"></script> 
    70 <script type="text/javascript" src="$g.server/js/OpenLayers.js" /> 
     74<script type="text/javascript" src="${openlayersImportPath}" /> 
    7175<script type="text/javascript" src="$g.server/js/LoadingPanel.js"></script> 
    7276 
Note: See TracChangeset for help on using the changeset viewer.