Changeset 5364 for cowsclient


Ignore:
Timestamp:
08/06/09 16:05:04 (10 years ago)
Author:
domlowe
Message:

Legend added to cows client

Location:
cowsclient
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • cowsclient/cowsclient/controllers/wmsviz.py

    r5360 r5364  
    4040        if 'REQUEST' in self.inputs:             
    4141            if self.inputs['REQUEST'] == 'GetWebMapContext': 
    42                 wmc= GetWebMapContext(self)                     
     42                wmc= GetWebMapContext(self) 
    4343                return wmc 
    4444            elif self.inputs['REQUEST'] == 'GetLegend': 
  • cowsclient/cowsclient/lib/wmc_util.py

    r5356 r5364  
    5353    response.headers['Content-Type'] = 'text/xml' 
    5454    response.write(wmcDoc) 
    55      
    5655 
    5756def GetLegend(self): 
    58     #not implemented yet 
    59     return None 
    60  
    61 #def GetLegend(self): 
    62 #    """ 
    63 #    Lookup a legend for a WMS map 
    64 #    NB, all required parameters are already included in the endpoint by this stage 
    65 #    """ 
    66 #    endpoint = self.inputs['ENDPOINT'] 
    67 #    if not endpoint: 
    68 #        raise exceptions.MissingParameterValue, "ENDPOINT parameter required" 
    69 #    log.info('Getting Legend from endpoint: ' + endpoint) 
    70 #    try: 
    71 #        req = urllib2.Request(endpoint,urllib.urlencode(request.params),{'Cookie': request.headers.get('Cookie', '')}) 
    72 #        filehandle = urllib2.urlopen(req) 
    73 #    except IOError: 
    74 #        raise exceptions.URLUnavailable, "Could not access WMC endpoint: %s" % endpoint 
    75 #    response.headers['Content-Type'] = 'text/xml' 
    76 #    response.write(filehandle.read()) 
     57    """ 
     58    Lookup a legend for a WMS map 
     59    NB, all required parameters are already included in the endpoint by this stage 
     60    """ 
     61    endpoint = self.inputs['ENDPOINT'] 
     62    if not endpoint: 
     63        raise exceptions.MissingParameterValue, "ENDPOINT parameter required" 
     64    try: 
     65        req = urllib2.Request(endpoint,urllib.urlencode(request.params),{'Cookie': request.headers.get('Cookie', '')}) 
     66        filehandle = urllib2.urlopen(req) 
     67    except IOError: 
     68        raise exceptions.URLUnavailable, "Could not access WMC endpoint: %s" % endpoint 
     69    response.headers['Content-Type'] = 'image/gif' 
     70    c.legendurl = endpoint 
     71    response.write(render('legendRender')) 
     72     
    7773     
    7874def RetrieveWebMapContext(self, endpoint): 
  • cowsclient/cowsclient/public/js/VisMapBox.js

    r5340 r5364  
    1 /** Top-level javascript file for the IPCC DDC visualisation application. 
     1/** Top-level javascript file for the COWS OGC client visualisation application. 
    22 
    33    @author Stephen Pascoe 
  • cowsclient/cowsclient/public/js/mapControl.js

    r5340 r5364  
    234234                { 
    235235                $('legend').innerHTML = ''; 
    236                         var legendHTML = xhr.responseXML.documentElement.innerHTML; 
     236                var legendHTML =xhr.responseText; 
    237237                        if (legendHTML) 
    238238                        $('legend').innerHTML = legendHTML; 
     
    264264                var url = topLayer.getFullRequestString({ 
    265265                                REQUEST: 'GetLegend', 
    266                                 FORMAT: 'text/html' 
     266                                //FORMAT: 'text/html' 
    267267                }); 
    268268 
  • cowsclient/setup.py

    r5342 r5364  
    88setup( 
    99    name='cowsclient', 
    10     version="0.0.5", 
     10    version="0.1.1",  
    1111    #description='', 
    1212    #author='', 
Note: See TracChangeset for help on using the changeset viewer.