Changeset 4079 for cows


Ignore:
Timestamp:
31/07/08 14:47:21 (11 years ago)
Author:
spascoe
Message:

Making JSON IE7 compatible

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cows/trunk/cows/pylons/templates/wms_capabilities_json.txt

    r4078 r4079  
    77    abstract: "${ds.abstracts[0]}", 
    88    {% end %} 
    9     crss: [{% for crs in ds.CRSs %}"${crs}",{% end %}], 
     9    crss: [${','.join(ds.CRSs)}], 
    1010    {% with exBBox = ds.wgs84BoundingBoxes[0] %} 
    1111    exbbox: [${exBBox.lowerCorner[0]}, ${exBBox.lowerCorner[1]}, ${exBBox.upperCorner[0]}, ${exBBox.upperCorner[1]}], 
     
    1313    bboxes: { 
    1414    {% for bb in ds.boundingBoxes %} 
    15       "${bb.crs}": [${'%.2f'%bb.lowerCorner[0]}, ${'%.2f'%bb.lowerCorner[1]}, ${'%.2f'%bb.upperCorner[0]}, ${'%.2f'%bb.upperCorner[1]}], 
     15      "${bb.crs}": [${'%.2f'%bb.lowerCorner[0]}, ${'%.2f'%bb.lowerCorner[1]}, ${'%.2f'%bb.upperCorner[0]}, ${'%.2f'%bb.upperCorner[1]}]{% if bb!=ds.boundingBoxes[-1]%},{% end %} 
    1616    {% end %} 
    1717    }, 
    1818    dimensions: { 
    19     {% for d_n, d in ds.dimensions.iteritems() %} 
     19    {% with d_ns = ds.dimensions.keys() %} 
     20    {% for d_n in d_ns %} 
    2021      "${d_n}": { 
    21         units: "${d.valuesUnit}", 
    22         unitSymbol: "${d.unitSymbol}", 
    23         default: "${d.defaultValue}", 
    24         extent: [{% for v in d.possibleValues.allowedValues %}"${v}",{% end %}], 
    25       }, 
     22        units: "${ds.dimensions[d_n].valuesUnit}", 
     23        unitSymbol: "${ds.dimensions[d_n].unitSymbol}", 
     24        default: "${ds.dimensions[d_n].defaultValue}", 
     25        extent: [${','.join(ds.dimensions[d_n].possibleValues.allowedValues)}], 
     26      }{% if d_n!=d_ns[-1] %},{% end %} 
    2627    {% end %} 
    2728    } 
    28   }, 
     29  }{% if ds != c.capabilities.contents.datasetSummaries[-1] %},{% end %} 
    2930  {% end %} 
    3031} 
Note: See TracChangeset for help on using the changeset viewer.