source: TI05-delivery/ows_framework/trunk/ows_server/ows_server/controllers/visualise.py @ 2865

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/TI05-delivery/ows_framework/trunk/ows_server/ows_server/controllers/visualise.py@2865
Revision 2865, 1.4 KB checked in by spascoe, 12 years ago (diff)

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 :-) ).

Line 
1from ows_server.lib.base import *
2from ows_server.lib.ndgInterface import interface
3
4
5class VisualiseController(BaseController):
6   
7    def __setup(self):
8       
9        c.fullpage=1  # we want the whole page
10        c.datasets = {}
11        c.bbox = (90, -180, 180, -90)
12        c.inpageid = 'api'
13        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')
19
20        for uri, dif in session.get('selection', []):
21            (rstatus, dataset) = interface.GetParsedCSML(uri)               
22            if not rstatus: 
23                c.xml='<div class="error">%s</div>'%dataset
24                return render_response('error')
25
26            c.datasets[uri] = dataset
27            if self.first is None: self.first=uri
28   
29    def index(self):
30       
31        self.__setup()
32        if c.datasets!={}:
33            c.visible='Dataset'
34            c.currentDataset=self.first
35
36        return render_response('visualise')
37       
38    def inpagetab(self,dataset,view):
39        ''' Take ajax request for inpage tab change '''
40        self.__setup()
41        c.visible=view
42        c.currentDataset=dataset
43       
44        c.fullpage=0 
45        return render_response('visualise',fragment=True)
46       
Note: See TracBrowser for help on using the repository browser.