source: cows/trunk/cows/pylons/templates/wms_capabilities_json.txt @ 4079

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/cows/trunk/cows/pylons/templates/wms_capabilities_json.txt@4079
Revision 4079, 1.2 KB checked in by spascoe, 11 years ago (diff)

Making JSON IE7 compatible

Line 
1{# Converted WMS-capabilities 1.3.0 XML to JSON #}
2{
3{% for ds in c.capabilities.contents.datasetSummaries %}
4  "${ds.identifier}": {
5    title: "${ds.titles[0]}",
6    {% if len(ds.abstracts)>0 %}
7    abstract: "${ds.abstracts[0]}",
8    {% end %}
9    crss: [${','.join(ds.CRSs)}],
10    {% with exBBox = ds.wgs84BoundingBoxes[0] %}
11    exbbox: [${exBBox.lowerCorner[0]}, ${exBBox.lowerCorner[1]}, ${exBBox.upperCorner[0]}, ${exBBox.upperCorner[1]}],
12    {% end %}
13    bboxes: {
14    {% for bb in ds.boundingBoxes %}
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 %}
16    {% end %}
17    },
18    dimensions: {
19    {% with d_ns = ds.dimensions.keys() %}
20    {% for d_n in d_ns %}
21      "${d_n}": {
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 %}
27    {% end %}
28    }
29  }{% if ds != c.capabilities.contents.datasetSummaries[-1] %},{% end %}
30  {% end %}
31}
Note: See TracBrowser for help on using the repository browser.