Ignore:
Timestamp:
14/12/09 23:32:34 (11 years ago)
Author:
astephen
Message:

Got bounding box added to MIDAS extractors. And in doing so they will work for all.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cows_wps/trunk/cows_wps/renderer/form_renderer.py

    r6124 r6125  
    117117 
    118118 
    119     def renderBBoxOLD(self, name, extent): 
     119    def renderBBox(self, name, extent): 
    120120        """ 
    121121        Renders a bounding box and N/W/S/E selectors. 
    122122        """ 
    123         html = """      <script type="text/javascript" src="/js/ext/jquery-1.3.2/jquery-1.3.2.js"></script> 
    124         <script type="text/javascript" src="http://openlayers.org/api/OpenLayers.js"></script> 
    125         <script type="text/javascript" src="/js/ui/openlayers-x.js"></script> 
    126         <script type="text/javascript" src="/js/ui/boundingBoxMapSelect.js"></script> 
    127         <script type="text/javascript"> 
    128                 var layers = new Array(); 
    129                 var layer_data = false; 
    130                 var bboxSelect = false; 
     123        if extent == False: extent = "90|-180|-90|180" 
     124        (n, w, s, e) = extent.split("|") 
    131125 
    132                 $(document).ready(function() { 
    133                         var layer_data = new OpenLayers.Layer.WMS( "World Map", "http://labs.metacarta.com/wms-c/Basic.py?", {layers: 'basic', format: 'image/png' } ); 
    134                         layers.push(layer_data); 
    135                         var bboxSelect = new BoundingBoxMapSelect('map', 'bounds_control_container', layers,  'bbox_hidden_input', null); 
    136                 }); 
    137         </script> 
    138  
    139         <div id="bounding_container"> 
    140                 <div id="bounds_control_container"></div>        
    141                 <div id="map_container"> 
    142                         <div id='map'></div> 
    143                 </div> 
    144                 <input type="hidden" name="bbox" id="bbox_hidden_input" value="" /> 
    145         </div> 
    146         """ 
     126        html = """    <div id="bounding_container"> 
     127        <div> BBox = <span id="bbox_show_val"></span></div> 
     128        <div id="bounds_control_container"></div> 
     129        <div id="map_container"> 
     130            <div id='map'></div> 
     131        </div> 
     132        <input type="hidden" name="%s" id="bbox_hidden_input" /> 
     133        <script type="text/javascript">var initial_extent = [%s, %s, %s, %s];</script> 
     134    </div> 
     135    """ % (name, n, w, s, e) 
    147136        return html      
    148137 
Note: See TracChangeset for help on using the changeset viewer.