Project

General

Profile

1
<!doctype html public "-//W3C//DTD HTML 4.0 Frameset//EN""http://www.w3.org/TR/REC-html40/frameset.dtd">
2
<html>
3
<head>
4
<title>
5
<a href='http://mapbuilder.sourceforge.net'>Community Map Builder</a> 27 Apr 2008 Overview
6
</title>
7
<link rel ="stylesheet" type="text/css" href="stylesheet.css" title="Style">
8
<script>
9
function asd() {
10
	
11
		parent.document.title="WmsCapabilities.js Overview";
12
	
13
}
14
</script>
15
</head>
16
<body bgcolor="white" onload="asd();">
17

    
18
<!-- ========== START OF NAVBAR ========== -->
19
<a name="navbar_top"><!-- --></a>
20
<table border="0" width="100%" cellpadding="1" cellspacing="0">
21
<tr>
22
<td colspan=2 bgcolor="#EEEEFF" class="NavBarCell1">
23
<a name="navbar_top_firstrow"><!-- --></a>
24
<table border="0" cellpadding="0" cellspacing="3">
25
  <tr align="center" valign="top">
26
  
27
  
28
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="overview-summary.html"><font class="NavBarFont1"><b>Overview</b></font></a>&nbsp;</td>
29
  <td bgcolor="#FFFFFF" class="NavBarCell1Rev">	&nbsp;<font class="NavBarFont1Rev"><b>File</b></font>&nbsp;</td>
30
  
31

    
32
  <td bgcolor="#FFFFFF" class="NavBarCell1"> 	<font class="NavBarFont1">Class</font>&nbsp;</td>
33
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="overview-tree.html"><font class="NavBarFont1"><b>Tree</b></font></a>&nbsp;</td>
34
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="index-all.html"--><font class="NavBarFont1"><b>Index</b></font></a>&nbsp;</td>
35
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="help-doc.html"><font class="NavBarFont1"><b>Help</b></font></a>&nbsp;</td>
36
  </tr>
37
</table>
38
</td>
39
<td bgcolor="#EEEEFF" align="right" valign="top">
40
<em>
41
<b><a href='http://mapbuilder.sourceforge.net'>Community Map Builder</a> 27 Apr 2008</b></em>
42
</td>
43
</tr>
44

    
45
<tr>
46
<td bgcolor="white" class="NavBarCell2"><font size="-2">
47
&nbsp;PREV&nbsp;
48
&nbsp;NEXT</font></td>
49
<td bgcolor="white" class="NavBarCell2"><font size="-2">
50
  <a href="index.html" target="_top"><b>FRAMES</b></a>  &nbsp;
51
&nbsp;<a href="overview-summary.html" target="_top"><b>NO FRAMES</b></a>
52
&nbsp;&nbsp;
53
<script>
54
  <!--
55
  if(window==top) {
56
    document.writeln('<A HREF="allclasses-noframe.html" TARGET=""><B>All Classes</B></A>');
57
  }
58
  //-->
59
</script>
60
<noscript>
61
<a href="allclasses-noframe.html" target=""><b>All Classes</b></a>
62
</noscript>
63
</font></td>
64
</tr>
65
</table>
66
<!-- =========== END OF NAVBAR =========== -->
67

    
68
<hr>
69
<center>
70
	
71
	   <h2>WmsCapabilities.js</h2>
72
	
73
</center>
74

    
75
	
76

    
77

    
78
<h4>Summary</h4>
79
<p>
80
	
81
		No overview generated for 'WmsCapabilities.js'<BR/><BR/>
82
	
83
</p>
84

    
85
<hr>
86

    
87

    
88
    <table border="1" cellpadding="3" cellspacing="0" width="100%">
89
    <tr bgcolor="#CCCCFF" class="TableHeadingColor">
90
    <td colspan=2><font size="+2">
91
    
92
        <b>Class Summary</b>
93
    
94
    </font></td>
95
    </tr>
96
    
97
    <tr bgcolor="white" class="TableRowColor">
98
    <td width="15%"><b><a href="WmsCapabilities.html">WmsCapabilities</a></b></td>
99
    <td>&nbsp;</td>
100
    </tr>
101
    
102
    </table>
103
    <hr/> 
104

    
105

    
106
<!-- ========== METHOD SUMMARY =========== -->
107

    
108
<!-- ========== END METHOD SUMMARY =========== -->
109

    
110

    
111
        <pre class="sourceview"><span class="comment">/*
112
License: LGPL as per: http://www.gnu.org/copyleft/lesser.html
113
$Id: WmsCapabilities.js 3887 2008-02-27 18:18:53Z ahocevar $
114
*/</span>
115
<span class="comment">
116
// Ensure this object's dependancies are loaded.</span>
117
mapbuilder.loadScript(baseDir+<span class="literal">"/model/ModelBase.js"</span>);
118

    
119
<span class="comment">/**
120
 * Stores a Web Map Server (WMS) Capabilities document as defined by the 
121
 * Open Geospatial Consortium (http://www.opengeospatial.org/) and extensions the the WMC.  
122
 *
123
 * <span class="attrib">@constructor</span>
124
 * <span class="attrib">@base</span> ModelBase
125
 * <span class="attrib">@author</span> Mike Adair
126
 * <span class="attrib">@param</span> modelNode   The model's XML object node from the configuration document.
127
 * <span class="attrib">@param</span> parent The model object that this widget belongs to.
128
 */</span>
129
<span class="reserved">function</span> WmsCapabilities(modelNode, parent) {
130
<span class="comment">  // Inherit the ModelBase functions and parameters</span>
131
  ModelBase.apply(<span class="reserved">this</span>, new Array(modelNode, parent));
132

    
133
  <span class="reserved">this</span>.namespace = <span class="literal">"xmlns:wms='http://www.opengis.net/wms' xmlns:xlink='http://www.w3.org/1999/xlink'"</span>;
134

    
135
  <span class="comment">/**
136
   * Returns the serverUrl for the WMS request passed in with the specified
137
   * HTTP method from the capabilities doc.
138
   * <span class="attrib">@param</span> requestName the WMS request to get the URL for
139
   * <span class="attrib">@param</span> method http method for the request
140
   * <span class="attrib">@param</span> feature ignored for WMS docs
141
   * <span class="attrib">@return</span> URL for the specified request with the specified method
142
   */</span>
143
  <span class="reserved">this</span>.getServerUrl = <span class="reserved">function</span>(requestName, method, feature) {
144
    var version = <span class="reserved">this</span>.getVersion();
145
    <span class="reserved">if</span> (version == <span class="literal">"1.0.0"</span>) {
146
      requestName = requestName.substring(3);  //strip of <span class="literal">"Get"</span> part of request name
147
      var xpath = <span class="literal">"/WMT_MS_Capabilities/Capability/Request/"</span>+requestName;
148
      <span class="reserved">if</span> (method.toLowerCase() == <span class="literal">"post"</span>) {
149
        xpath += <span class="literal">"/DCPType/HTTP/Post"</span>;
150
      } <span class="reserved">else</span> {
151
        xpath += <span class="literal">"/DCPType/HTTP/Get"</span>;
152
      }
153
      <span class="reserved">return</span> <span class="reserved">this</span>.doc.selectSingleNode(xpath).getAttribute(<span class="literal">"onlineResource"</span>);
154
    } <span class="reserved">else</span> {
155
      var xpath = <span class="literal">"/WMT_MS_Capabilities/Capability/Request/"</span>+requestName;
156
      <span class="reserved">if</span> (method.toLowerCase() == <span class="literal">"post"</span>) {
157
        xpath += <span class="literal">"/DCPType/HTTP/Post/OnlineResource"</span>;
158
      } <span class="reserved">else</span> {
159
        xpath += <span class="literal">"/DCPType/HTTP/Get/OnlineResource"</span>;
160
      }
161
      <span class="reserved">return</span> <span class="reserved">this</span>.doc.selectSingleNode(xpath).getAttribute(<span class="literal">"xlink:href"</span>);
162
    }
163
  }
164

    
165
  <span class="comment">/**
166
   * Returns the version for the WMS
167
   * <span class="attrib">@return</span> the WMS version
168
   */</span>
169
  <span class="reserved">this</span>.getVersion = <span class="reserved">function</span>() {
170
    var xpath = <span class="literal">"/WMT_MS_Capabilities"</span>;
171
    <span class="reserved">return</span> <span class="reserved">this</span>.doc.selectSingleNode(xpath).getAttribute(<span class="literal">"version"</span>);
172
  }
173

    
174
  <span class="comment">/**
175
   * <span class="attrib">@return</span> the title of the WMS server
176
   */</span>
177
  <span class="reserved">this</span>.getServerTitle = <span class="reserved">function</span>() {
178
    var xpath = <span class="literal">"/WMT_MS_Capabilities/Service/Title"</span>;
179
    <span class="reserved">return</span> Mapbuilder.getProperty(<span class="reserved">this</span>.doc, xpath, <span class="literal">"no title"</span>);
180
  }
181

    
182
  <span class="comment">/**
183
   * <span class="attrib">@return</span> the first image format listed
184
   */</span>
185
  <span class="reserved">this</span>.getImageFormat = <span class="reserved">function</span>() {
186
    var version = <span class="reserved">this</span>.getVersion();
187
    <span class="reserved">if</span> (version == <span class="literal">"1.0.0"</span>) {
188
      var xpath = <span class="literal">"/WMT_MS_Capabilities/Capability/Request/Map/Format"</span>;  //strip of <span class="literal">"Get"</span> part of request name
189
      var node = <span class="reserved">this</span>.doc.selectSingleNode(xpath);
190
      <span class="reserved">if</span>(_SARISSA_IS_IE) {
191
        <span class="reserved">return</span> <span class="literal">"image/"</span>+node.firstChild.baseName.toLowerCase();
192
      }
193
      <span class="reserved">else</span> {
194
	    <span class="reserved">return</span> <span class="literal">"image/"</span>+node.firstChild.localName.toLowerCase();
195
	  }
196
    } <span class="reserved">else</span> {
197
      var xpath = <span class="literal">"/WMT_MS_Capabilities/Capability/Request/GetMap/Format"</span>;
198
      <span class="reserved">return</span> Mapbuilder.getProperty(<span class="reserved">this</span>.doc, xpath);
199
    }
200
  }
201

    
202
  <span class="comment">/**
203
   * <span class="attrib">@return</span> the name of the WMS server
204
   */</span>
205
  <span class="reserved">this</span>.getServiceName = <span class="reserved">function</span>() {
206
    var xpath = <span class="literal">"/WMT_MS_Capabilities/Service/Name"</span>;
207
    <span class="reserved">return</span> Mapbuilder.getProperty(<span class="reserved">this</span>.doc, xpath);
208
  }
209

    
210
  <span class="comment">/**
211
   * Returns the Layer node with the specified name from the list of nodes
212
   * selected by the nodeSelectXpath from the capabilities doc.
213
   * <span class="attrib">@param</span> featureName name of the featureType to look up
214
   * <span class="attrib">@return</span> the Layer node with the specified name.
215
   */</span>
216
  <span class="reserved">this</span>.getFeatureNode = <span class="reserved">function</span>(featureName) {
217
    <span class="reserved">return</span> <span class="reserved">this</span>.doc.selectSingleNode(<span class="reserved">this</span>.nodeSelectXpath+<span class="literal">"[Name='"</span>+featureName+<span class="literal">"']"</span>);
218
  }
219

    
220
}
221

    
222
</pre>
223
	<hr>
224

    
225

    
226

    
227
<!-- ========== START OF NAVBAR ========== -->
228
<a name="navbar_top"><!-- --></a>
229
<table border="0" width="100%" cellpadding="1" cellspacing="0">
230
<tr>
231
<td colspan=2 bgcolor="#EEEEFF" class="NavBarCell1">
232
<a name="navbar_top_firstrow"><!-- --></a>
233
<table border="0" cellpadding="0" cellspacing="3">
234
  <tr align="center" valign="top">
235
  
236
  
237
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="overview-summary.html"><font class="NavBarFont1"><b>Overview</b></font></a>&nbsp;</td>
238
  <td bgcolor="#FFFFFF" class="NavBarCell1Rev">	&nbsp;<font class="NavBarFont1Rev"><b>File</b></font>&nbsp;</td>
239
  
240

    
241
  <td bgcolor="#FFFFFF" class="NavBarCell1"> <font class="NavBarFont1">Class</font>&nbsp;</td>
242
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="overview-tree.html"><font class="NavBarFont1"><b>Tree</b></font></a>&nbsp;</td>
243
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="index-all.html"--><font class="NavBarFont1"><b>Index</b></font></a>&nbsp;</td>
244
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="help-doc.html"><font class="NavBarFont1"><b>Help</b></font></a>&nbsp;</td>
245
  </tr>
246
</table>
247
</td>
248
<td bgcolor="#EEEEFF" align="right" valign="top"><em>
249
<b><a href='http://mapbuilder.sourceforge.net'>Community Map Builder</a> 27 Apr 2008</b></em>
250
</td>
251
</tr>
252

    
253
<tr>
254
<td bgcolor="white" class="NavBarCell2"><font size="-2">
255
&nbsp;PREV&nbsp;
256
&nbsp;NEXT</font></td>
257
<td bgcolor="white" class="NavBarCell2"><font size="-2">
258
  <a href="index.html" target="_top"><b>FRAMES</b></a>  &nbsp;
259
&nbsp;<a href="overview-summary.html" target="_top"><b>NO FRAMES</b></a>
260
&nbsp;&nbsp;
261
<script>
262
  <!--
263
  if(window==top) {
264
    document.writeln('<A HREF="allclasses-noframe.html" TARGET=""><B>All Classes</B></A>');
265
  }
266
  //-->
267
</script>
268
<noscript>
269
<a href="allclasses-noframe.html" target=""><b>All Classes</b></a>
270
</noscript>
271
</font></td>
272
</tr>
273
</table>
274
<!-- =========== END OF NAVBAR =========== -->
275

    
276
<hr>
277
<font size="-1">
278

    
279
</font>
280
<div class="jsdoc_ctime">Documentation generated by <a href="http://jsdoc.sourceforge.net/" target="_parent">JSDoc</a> on Sun Apr 27 20:30:54 2008</div>
281
</body>
282
</html>
(308-308/316)