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="CollectionList.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>CollectionList.js</h2>
72
	
73
</center>
74

    
75
	
76

    
77

    
78
<h4>Summary</h4>
79
<p>
80
	
81
		No overview generated for 'CollectionList.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="CollectionList.html">CollectionList</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
Author:       Cameron Shorter cameronAtshorter.net
113
License:      LGPL as per: http://www.gnu.org/copyleft/lesser.html
114

    
115
$Id: CollectionList.js 3888 2008-02-27 18:25:45Z ahocevar $
116
*/</span>
117
<span class="comment">
118
// Ensure this object's dependancies are loaded.</span>
119
mapbuilder.loadScript(baseDir+<span class="literal">"/widget/WidgetBaseXSL.js"</span>);
120

    
121
<span class="comment">/**
122
 * A widget to display a list of context docs to pick from.  This is a view of 
123
 * a Context Collection as specified in the OGC Context specification.
124
 * The default xsl stylesheet for this widget also uses the switchMap
125
 * function, which allows to switch to a different map context.
126
 * <span class="attrib">@constructor</span>
127
 * <span class="attrib">@base</span> WidgetBaseXSL
128
 * <span class="attrib">@param</span> widgetNode  The widget's XML object node from the configuration document.
129
 * <span class="attrib">@param</span> model       The model object that this widget belongs to.
130
 */</span>
131

    
132
<span class="reserved">function</span> CollectionList(widgetNode, model) {
133
  WidgetBaseXSL.apply(<span class="reserved">this</span>,new Array(widgetNode, model));
134

    
135
  <span class="comment">/**
136
   * Switch to another map context, keeping the current extent.
137
   * <span class="attrib">@param</span> objRef this widget
138
   * <span class="attrib">@modelUrl</span> the URL of the context we want to switch to.
139
   */</span>
140
  <span class="reserved">this</span>.switchMap = <span class="reserved">function</span>(objRef, modelUrl) {
141
<span class="comment">    // save the current extent</span>
142
    objRef.extent = objRef.targetModel.map.getExtent();
143
    objRef.srs = objRef.targetModel.getSRS();
144
    objRef.scale = objRef.targetModel.map.getScale();
145
   
146
    objRef.targetModel.addListener( <span class="literal">"loadModel"</span>, objRef.setExtent, objRef );
147
    config.loadModel( objRef.targetModel.id, modelUrl );
148
  }
149
  
150
  <span class="comment">/**
151
   * Sets the extent of the map that we just switched to.
152
   * Called when the map is reloaded with the new context.
153
   * <span class="attrib">@param</span> objRef this widget
154
   */</span>
155
  <span class="reserved">this</span>.setExtent = <span class="reserved">function</span> (objRef) {
156
    objRef.targetModel.removeListener( <span class="literal">"loadModel"</span>, objRef.setExtent, objRef );
157

    
158
    var bbox = objRef.extent.toBBOX().split(/,/);  
159
    <span class="reserved">if</span> (objRef.targetModel.getSRS().toUpperCase() != objRef.srs.toUpperCase()) {
160
      var targetProj = new OpenLayers.Projection(objRef.targetModel.getSRS());
161
      var srcProj = new OpenLayers.Projection(objRef.srs);
162
    	var ptLL=new OpenLayers.Geometry.Point(bbox[0],bbox[1]);
163
    	var ptUR=new OpenLayers.Geometry.Point(bbox[2],bbox[3]);
164
  		ptLL.transform(srcProj, targetProj);
165
	    ptUR.transform(srcProj, targetProj);
166
      objRef.extent = new OpenLayers.Bounds(ptLL.x, ptLL.y, ptUR.x, ptUR.y);
167
    }
168
    <span class="reserved">if</span> (objRef.targetModel.map.getExtent().containsBounds(objRef.extent, false, false)) {
169
      objRef.targetModel.map.zoomToExtent(objRef.extent);
170
      <span class="reserved">if</span> (!objRef.targetModel.map.fractionalZoom &amp;&amp; objRef.targetModel.map.getScale() &gt; objRef.scale) {
171
        objRef.targetModel.map.zoomIn();
172
      }
173
    }
174
  }
175
}
176
</pre>
177
	<hr>
178

    
179

    
180

    
181
<!-- ========== START OF NAVBAR ========== -->
182
<a name="navbar_top"><!-- --></a>
183
<table border="0" width="100%" cellpadding="1" cellspacing="0">
184
<tr>
185
<td colspan=2 bgcolor="#EEEEFF" class="NavBarCell1">
186
<a name="navbar_top_firstrow"><!-- --></a>
187
<table border="0" cellpadding="0" cellspacing="3">
188
  <tr align="center" valign="top">
189
  
190
  
191
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="overview-summary.html"><font class="NavBarFont1"><b>Overview</b></font></a>&nbsp;</td>
192
  <td bgcolor="#FFFFFF" class="NavBarCell1Rev">	&nbsp;<font class="NavBarFont1Rev"><b>File</b></font>&nbsp;</td>
193
  
194

    
195
  <td bgcolor="#FFFFFF" class="NavBarCell1"> <font class="NavBarFont1">Class</font>&nbsp;</td>
196
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="overview-tree.html"><font class="NavBarFont1"><b>Tree</b></font></a>&nbsp;</td>
197
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="index-all.html"--><font class="NavBarFont1"><b>Index</b></font></a>&nbsp;</td>
198
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="help-doc.html"><font class="NavBarFont1"><b>Help</b></font></a>&nbsp;</td>
199
  </tr>
200
</table>
201
</td>
202
<td bgcolor="#EEEEFF" align="right" valign="top"><em>
203
<b><a href='http://mapbuilder.sourceforge.net'>Community Map Builder</a> 27 Apr 2008</b></em>
204
</td>
205
</tr>
206

    
207
<tr>
208
<td bgcolor="white" class="NavBarCell2"><font size="-2">
209
&nbsp;PREV&nbsp;
210
&nbsp;NEXT</font></td>
211
<td bgcolor="white" class="NavBarCell2"><font size="-2">
212
  <a href="index.html" target="_top"><b>FRAMES</b></a>  &nbsp;
213
&nbsp;<a href="overview-summary.html" target="_top"><b>NO FRAMES</b></a>
214
&nbsp;&nbsp;
215
<script>
216
  <!--
217
  if(window==top) {
218
    document.writeln('<A HREF="allclasses-noframe.html" TARGET=""><B>All Classes</B></A>');
219
  }
220
  //-->
221
</script>
222
<noscript>
223
<a href="allclasses-noframe.html" target=""><b>All Classes</b></a>
224
</noscript>
225
</font></td>
226
</tr>
227
</table>
228
<!-- =========== END OF NAVBAR =========== -->
229

    
230
<hr>
231
<font size="-1">
232

    
233
</font>
234
<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>
235
</body>
236
</html>
(222-222/316)