Ignore:
Timestamp:
21/02/08 15:30:08 (12 years ago)
Author:
spascoe
Message:

More helpers and correction to domain model.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TI05-delivery/ows_framework/branches/ows_framework-refactor/ows_common/ows_common/pylons/ows_controller.py

    r3487 r3496  
    118118    ops[opName] = helpers.operation(url_for(), formats=formats) 
    119119 
    120 def addLayer(name, title, abstract, srs, bbox): 
     120def addLayer(name, title, abstract, srs, bbox, dimensions={}): 
     121    """ 
     122    @param dimensions: Dictionary of dictionaries D[k1][k2]=val where 
     123        k1 is dimension name, k2 is a keyword parameter to send to 
     124        helpers.wms_dimension and val is it's value. 
     125 
     126    @todo: The helpers interface is leaking through.  Could make cleaner. 
     127 
     128    """ 
     129         
    121130    if c.capabilities.contents is None: 
    122131        c.capabilities.contents = Contents() 
    123132 
    124     layer = helpers.wms_layer(url_for(), name, title, srs, bbox, abstract) 
     133    layer = helpers.wms_layer(name, title, srs, bbox, abstract) 
     134 
     135    for k1, kwargs in dimensions.items(): 
     136        dim = helpers.wms_dimension(**kwargs) 
     137        layer.dimensions[k1] = dim 
     138 
    125139    c.capabilities.contents.datasetSummaries.append(layer) 
    126140 
Note: See TracChangeset for help on using the changeset viewer.