1
|
/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
|
2
|
* full list of contributors). Published under the 2-clause BSD license.
|
3
|
* See license.txt in the OpenLayers distribution or repository for the
|
4
|
* full text of the license. */
|
5
|
|
6
|
/**
|
7
|
* @requires OpenLayers/Format/WCSCapabilities/v1.js
|
8
|
* @requires OpenLayers/Format/OWSCommon/v1_1_0.js
|
9
|
*/
|
10
|
|
11
|
/**
|
12
|
* Class: OpenLayers.Format.WCSCapabilities/v1_1_0
|
13
|
* Read WCS Capabilities version 1.1.0.
|
14
|
*
|
15
|
* Inherits from:
|
16
|
* - <OpenLayers.Format.WCSCapabilities.v1>
|
17
|
*/
|
18
|
OpenLayers.Format.WCSCapabilities.v1_1_0 = OpenLayers.Class(
|
19
|
OpenLayers.Format.WCSCapabilities.v1, {
|
20
|
|
21
|
/**
|
22
|
* Property: namespaces
|
23
|
* {Object} Mapping of namespace aliases to namespace URIs.
|
24
|
*/
|
25
|
namespaces: {
|
26
|
wcs: "http://www.opengis.net/wcs/1.1",
|
27
|
xlink: "http://www.w3.org/1999/xlink",
|
28
|
xsi: "http://www.w3.org/2001/XMLSchema-instance",
|
29
|
ows: "http://www.opengis.net/ows/1.1"
|
30
|
},
|
31
|
|
32
|
/**
|
33
|
* APIProperty: errorProperty
|
34
|
* {String} Which property of the returned object to check for in order to
|
35
|
* determine whether or not parsing has failed. In the case that the
|
36
|
* errorProperty is undefined on the returned object, the document will be
|
37
|
* run through an OGCExceptionReport parser.
|
38
|
*/
|
39
|
errorProperty: "operationsMetadata",
|
40
|
|
41
|
/**
|
42
|
* Constructor: OpenLayers.Format.WCSCapabilities.v1_1_0
|
43
|
* Create a new parser for WCS capabilities version 1.1.0.
|
44
|
*
|
45
|
* Parameters:
|
46
|
* options - {Object} An optional object whose properties will be set on
|
47
|
* this instance.
|
48
|
*/
|
49
|
|
50
|
/**
|
51
|
* Property: readers
|
52
|
* Contains public functions, grouped by namespace prefix, that will
|
53
|
* be applied when a namespaced node is found matching the function
|
54
|
* name. The function will be applied in the scope of this parser
|
55
|
* with two arguments: the node being read and a context object passed
|
56
|
* from the parent.
|
57
|
*/
|
58
|
readers: {
|
59
|
"wcs": OpenLayers.Util.applyDefaults({
|
60
|
// In 1.0.0, this was WCS_Capabilties, in 1.1.0, it's Capabilities
|
61
|
"Capabilities": function(node, obj) {
|
62
|
this.readChildNodes(node, obj);
|
63
|
},
|
64
|
"Contents": function(node, request) {
|
65
|
request.contentMetadata = [];
|
66
|
this.readChildNodes(node, request.contentMetadata);
|
67
|
},
|
68
|
"CoverageSummary": function(node, contentMetadata) {
|
69
|
var coverageSummary = {};
|
70
|
// Read the summary:
|
71
|
this.readChildNodes(node, coverageSummary);
|
72
|
|
73
|
// Add it to the contentMetadata array:
|
74
|
contentMetadata.push(coverageSummary);
|
75
|
},
|
76
|
"Identifier": function(node, coverageSummary) {
|
77
|
coverageSummary.identifier = this.getChildValue(node);
|
78
|
},
|
79
|
"Title": function(node, coverageSummary) {
|
80
|
coverageSummary.title = this.getChildValue(node);
|
81
|
},
|
82
|
"Abstract": function(node, coverageSummary) {
|
83
|
coverageSummary["abstract"] = this.getChildValue(node);
|
84
|
},
|
85
|
"SupportedCRS": function(node, coverageSummary) {
|
86
|
var crs = this.getChildValue(node);
|
87
|
if(crs) {
|
88
|
if(!coverageSummary.supportedCRS) {
|
89
|
coverageSummary.supportedCRS = [];
|
90
|
}
|
91
|
coverageSummary.supportedCRS.push(crs);
|
92
|
}
|
93
|
},
|
94
|
"SupportedFormat": function(node, coverageSummary) {
|
95
|
var format = this.getChildValue(node);
|
96
|
if(format) {
|
97
|
if(!coverageSummary.supportedFormat) {
|
98
|
coverageSummary.supportedFormat = [];
|
99
|
}
|
100
|
coverageSummary.supportedFormat.push(format);
|
101
|
}
|
102
|
}
|
103
|
}, OpenLayers.Format.WCSCapabilities.v1.prototype.readers["wcs"]),
|
104
|
"ows": OpenLayers.Format.OWSCommon.v1_1_0.prototype.readers["ows"]
|
105
|
},
|
106
|
|
107
|
CLASS_NAME: "OpenLayers.Format.WCSCapabilities.v1_1_0"
|
108
|
|
109
|
});
|