Changeset 5574 for cowsclient


Ignore:
Timestamp:
06/08/09 13:10:05 (10 years ago)
Author:
pnorton
Message:

Added an initialSelection to fix the problem of get figure not working until an area on the map has been selected.

Location:
cowsclient/branches/qesdi/cowsclient
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • cowsclient/branches/qesdi/cowsclient/public/js/boundsControl.js

    r5563 r5574  
    4646     *    is not set, a default markup is used 
    4747     */ 
    48     initialize: function(domainDivID, formID, controlMarkup)  
     48    initialize: function(domainDivID, initialBounds, formID, controlMarkup)  
    4949    { 
    5050        this.domainDivID = domainDivID; 
     
    6363         
    6464        this._initDomainDiv(); 
     65         
     66        if (initialBounds != null) { 
     67            this.setSelection(initialBounds); 
     68        } 
     69        else { 
     70            this.setSelection(this.GLOBAL_BOUNDS); 
     71        } 
    6572    }, 
    6673 
     
    112119        } 
    113120     
    114         this.setSelection(this.GLOBAL_BOUNDS); 
     121         
    115122    }, 
    116123     
  • cowsclient/branches/qesdi/cowsclient/public/js/figureBuilder.js

    r5557 r5574  
    11 
    2 FigureBuilder = function(formId, buttonId) { 
     2FigureBuilder = function(formId, buttonId, initialBounds) { 
    33        this._form = document.getElementById(formId); 
    44        this._button = document.getElementById(buttonId); 
     
    1010        this._handler = addHTMLEventListener(this._button, 'click', this.createFigure, this); 
    1111         
    12         this._curretnSelection = null; 
     12        this._currentSelection = initialBounds; 
    1313} 
    1414 
  • cowsclient/branches/qesdi/cowsclient/public/js/mapControl.js

    r5572 r5574  
    2626     */ 
    2727    initialize: function(div, numZoomLevels, mapWidth, showCoast,  
    28                          baseLayerURL, baseLayerParams )  
     28                         baseLayerURL, baseLayerParams, initialBounds )  
    2929    { 
    3030        this.figureCounter = 1; 
     
    8888//        this.updateVisLayer(); 
    8989 
    90         this.maxExtent = new OpenLayers.Bounds(-180,-90,180,90); 
     90        this.maxExtent = initialBounds; 
    9191        this.map.zoomToExtent(this.maxExtent);     
    9292         
  • cowsclient/branches/qesdi/cowsclient/templates/wmsviz.html

    r5571 r5574  
    106106         
    107107    var wmcRetriever = new WMCRetriever(); 
     108 
     109        var initialBounds = new OpenLayers.Bounds(-180,-90,180,90); 
    108110         
    109111        layerList = new LayerList('layer_list');         
     
    112114    var legendContainer = new LegendContainer('legend'); 
    113115 
    114     var figBuilder = new FigureBuilder('figureForm','make_figure_btn'); 
    115  
    116      
    117     var boundsControl = new WMSC.BoundsControl('dims'); 
     116    var figBuilder = new FigureBuilder('figureForm','make_figure_btn', initialBounds); 
     117 
     118    var boundsControl = new WMSC.BoundsControl('dims', initialBounds); 
    118119     
    119120    var coordControl = null; 
     
    126127    legendContainer.addLayerParametersHandlers(layerParameters.events); 
    127128     
    128     app = new WMSC.VisApp('map', 10, 640, true, baseLayerData.url, baseLayerData.params); 
     129    app = new WMSC.VisApp('map', 10, 640, true, baseLayerData.url, baseLayerData.params, initialBounds); 
    129130 
    130131    boundsControl.addMapSelectionChanged(app.events) 
Note: See TracChangeset for help on using the changeset viewer.