Changeset 2865 for TI05-delivery


Ignore:
Timestamp:
31/08/07 16:57:44 (12 years ago)
Author:
spascoe
Message:

First glimpse of visualise working.

It's not connected to the selection control yet. You need to explicitly
give it a granuleURI, featureId and time point. The form is populated with
an example.

Update is controlled from the ndgPage.kid:updateVis() function
which calls VisMapBox?.js:VisApp.updateVisLayer().

Note it won't work unless the data is visible at the location in the CSML (/badc/ipcc-ddc/... in the example).

I can see the WMS isn't drawing tiles correctly at high longitudes. (New Zealand gets a raw deal again :-) ).

Location:
TI05-delivery/ows_framework/trunk/ows_server/ows_server
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • TI05-delivery/ows_framework/trunk/ows_server/ows_server/controllers/visualise.py

    r2862 r2865  
    99        c.fullpage=1  # we want the whole page 
    1010        c.datasets = {} 
     11        c.bbox = (90, -180, 180, -90) 
    1112        c.inpageid = 'api' 
    1213        self.first=None 
     14 
     15        # Select a default view 
     16        c.defaultView = dict(granuleURI='badc.nerc.ac.uk__NDG-A0__Sjjr5v40', 
     17                             featureId='LN4Bi8hb', 
     18                             time='1905-01-15T00:00:00.0') 
    1319 
    1420        for uri, dif in session.get('selection', []): 
  • TI05-delivery/ows_framework/trunk/ows_server/ows_server/public/layout/ndg2.css

    r2862 r2865  
    143143/* NumSim */ 
    144144 
     145#visMap {width: 600px; height: 300px; border: 1px solid black;} 
    145146 
    146147.Model {margin: 5px 5px 5px 20px; border: 1px solid #3c78b5; clear:both;} 
  • TI05-delivery/ows_framework/trunk/ows_server/ows_server/public/test_openlayers.html

    r2621 r2865  
    1818            //    "http://labs.metacarta.com/wms/vmap0?", {layers: 'basic'});  
    1919 
     20 
     21            // http://saturn.badc.rl.ac.uk:8080/wms/badc.nerc.ac.uk__NDG-A0__AWQX8gTc?request=GetMap&version=1.3.0&layers=EhWv0qW5&bbox=-180,-90,180,90&width=600&height=300&Styles=&CRS=CRS:84&format=image/png&time=2024-01-15T00:00:00.0 
    2022            var csml_wms = new OpenLayers.Layer.WMS( "Test CSML layer", 
    21                 "http://saturn.badc.rl.ac.uk:8080/clim_10/wms?", 
    22                 {layers: 'SlRBzxwq', 
     23                "http://saturn.badc.rl.ac.uk:8080/wms/badc.nerc.ac.uk__NDG-A0__AWQX8gTc", 
     24                {layers: 'EhWv0qW5', 
    2325                 CRS: 'CRS:84', format: 'image/png', version: '1.3.0', 
    24                  styles: '', time: '1935-01-15T00:00:00.0' 
     26                 styles: '', time: '2024-01-15T00:00:00.0' 
    2527                 }); 
    2628            map.addLayers([//ol_wms,  
  • TI05-delivery/ows_framework/trunk/ows_server/ows_server/templates/ndgPage.kid

    r2858 r2865  
    1313        <script py:if="ol==1" src="/js/openlayers-x.js"/> 
    1414        <script py:if="ol==1" src="/js/OLMapBox.js"/> 
     15 
     16        <!--! At some stage we should put this as a separate option --> 
     17        <script py:if="ol==1" src="/js/VisMapBox.js"/> 
     18 
    1519        <link media="all, screen" href="/layout/ndg2.css" type="text/css" rel="stylesheet"/> 
    1620 
     
    2024            app = new OLMapBoxApp('map','discoForm', 440, 10); 
    2125          } 
     26 
     27          function initVisMapBox() { 
     28            app = new VisApp('visMap', 'visForm', 600, 10); 
     29          } 
     30 
     31          function updateVis(formId) { 
     32              var form = $(formId); 
     33              form.granuleURI.value, form.featureId.value, form.time.value 
     34              var wmsURL = "${h.url_for(controller='csml_wms', uri='')}" + form.granuleURI.value; 
     35              app.updateVisLayer(wmsURL, form.featureId.value, form.time.value); 
     36          } 
     37 
    2238        </script> 
    2339 
  • TI05-delivery/ows_framework/trunk/ows_server/ows_server/templates/visualise.kid

    r2862 r2865  
    11<html py:extends="'ndgPage.kid'" xmlns="http://www.w3.org/1999/xhtml" xmlns:py="http://purl.org/kid/ns#"> 
    22 
    3     <head py:replace="pagehead(0)"/> 
     3    <head py:replace="pagehead(1)"/> 
    44     
    55    <div py:def="notebook(divid)"> 
     
    4444    <div py:if="not c.fullpage" py:replace="notebook(c.inpageid)"/> 
    4545 
    46     <body> 
     46    <body onload="initVisMapBox()"> 
    4747     
    48     <div py:if="c.fullpage" id="entirepage"> 
    49         <div py:replace="header()"/> 
    50         <div py:replace="PageTabs('Visualise')"/> 
    51         <div py:replace="searchOneLine()"/> 
    52         <div id="contents"> 
    53             <div py:if="'selection' in session"> 
    54                 <p> The visualisation feature is not fully implemented. </p> 
    55                 <div py:replace="notebook(c.inpageid)"/> 
    56             </div> 
    57             <div py:if="'selection' not in session"> 
    58                 <p> There are no selected datasets </p> 
    59             </div>         
    60         </div> 
    61         <div py:replace="footer()"/> 
    62     </div> 
     48      <div py:if="c.fullpage" id="entirepage"> 
     49        <div py:replace="header()"/> 
     50        <div py:replace="PageTabs('Visualise')"/> 
     51        <div py:replace="searchOneLine()"/> 
     52        <div id="contents"> 
     53          <table> 
     54            <tr> 
     55              <td> 
     56                <div id="visMap"></div> 
     57              </td> 
     58              <td> 
     59                <form action="" name="visForm" id="visForm"> 
     60                  <table> 
     61                    <tr><td>Northerly Latitude:</td> 
     62                    <td colspan="2" align="center"> 
     63                      <input size="7" value="${c.bbox[0]}" name="bboxN"/> 
     64                    </td></tr> 
     65                    <tr><td>Longitudinal Extent:</td> 
     66                    <td align="center"><input size="8" value="${c.bbox[1]}" name="bboxW"/></td> 
     67                    <td align="center"><input size="8" value="${c.bbox[2]}" name="bboxE"/></td></tr> 
     68                    <tr><td> Southerly Latitude:</td> 
     69                    <td colspan="2" align="center"> 
     70                      <input size="7" value="${c.bbox[3]}" name="bboxS"/> 
     71                    </td></tr> 
     72                    <tr><td colspan="3">(Units: degrees, north and east positive)</td></tr> 
     73                  </table> 
     74                </form> 
     75              </td> 
     76            </tr> 
     77          </table> 
     78          <div> 
     79            <form name="visSelect" id="visSelect" onchange="updateVis('visSelect')"> 
     80              Granule URI: <input type="text" name="granuleURI" value="${c.defaultView['granuleURI']}"/> 
     81              Feature ID: <input type="text" name="featureId" value="${c.defaultView['featureId']}"/> 
     82              Time: <input type="text" name="time" value="${c.defaultView['time']}"/> 
     83              <input type="button" value="Update" onclick="updateVis('visSelect')"/> 
     84            </form> 
     85          </div> 
     86 
     87          <div py:if="'selection' in session"> 
     88            <p> The visualisation feature is not fully implemented. </p> 
     89            <div py:replace="notebook(c.inpageid)"/> 
     90          </div> 
     91          <div py:if="'selection' not in session"> 
     92            <p> There are no selected datasets </p> 
     93          </div>         
     94        </div> 
     95      </div> 
     96      <div py:replace="footer()"/> 
    6397    </body> 
    6498</html> 
Note: See TracChangeset for help on using the changeset viewer.