Ignore:
Timestamp:
10/06/10 23:04:13 (10 years ago)
Author:
astephen
Message:

Added checker for bbox selection.

File:
1 edited

Legend:

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

    r6125 r6977  
    9999        return html 
    100100 
    101     def renderBBox(self, name, extent="90|-180|-90|180"): 
     101    def OLDrenderBBox(self, name, extent="90|-180|-90|180"): 
    102102        """ 
    103103        Renders a bounding box and N/W/S/E/ selectors. 
     
    120120        """ 
    121121        Renders a bounding box and N/W/S/E selectors. 
     122        ``extent`` is received as a string of "north|west|south|east". 
    122123        """ 
    123124        if extent == False: extent = "90|-180|-90|180" 
     
    130131            <div id='map'></div> 
    131132        </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) 
     133            <input type="hidden" name="%s" id="bbox_hidden_input" /> 
     134            <script type="text/javascript"> 
     135                var initial_extent = [%s, %s, %s, %s]; 
     136                addValidator('%s', 'bounding_box', extent, 'Your selected spatial bounding box must overlap with the available extent of: (%s) as ("north|west|south|east").', false); 
     137            </script> 
     138        </div> 
     139        """ % (name, n, w, s, e, name, extent) 
     140 
    136141        return html      
    137142 
Note: See TracChangeset for help on using the changeset viewer.