1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" |
---|
2 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
---|
3 | |
---|
4 | <html xmlns="http://www.w3.org/1999/xhtml"> |
---|
5 | <head> |
---|
6 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
---|
7 | |
---|
8 | <title>GeoExt.plugins.PrintExtent — GeoExt v1.0</title> |
---|
9 | <link rel="stylesheet" href="../../../_static/geoext.css" type="text/css" /> |
---|
10 | <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" /> |
---|
11 | <script type="text/javascript"> |
---|
12 | var DOCUMENTATION_OPTIONS = { |
---|
13 | URL_ROOT: '../../../', |
---|
14 | VERSION: '1.0', |
---|
15 | COLLAPSE_MODINDEX: false, |
---|
16 | FILE_SUFFIX: '.html', |
---|
17 | HAS_SOURCE: true |
---|
18 | }; |
---|
19 | </script> |
---|
20 | <script type="text/javascript" src="../../../_static/jquery.js"></script> |
---|
21 | <script type="text/javascript" src="../../../_static/doctools.js"></script> |
---|
22 | <link rel="shortcut icon" href="../../../_static/favicon.ico"/> |
---|
23 | <link rel="top" title="GeoExt v1.0" href="../../../index.html" /> |
---|
24 | <link rel="up" title="GeoExt.plugins" href="../plugins.html" /> |
---|
25 | <link rel="next" title="GeoExt.plugins.PrintPageField" href="PrintPageField.html" /> |
---|
26 | <link rel="prev" title="GeoExt.plugins.AttributeForm" href="AttributeForm.html" /> |
---|
27 | |
---|
28 | |
---|
29 | |
---|
30 | |
---|
31 | |
---|
32 | |
---|
33 | </head> |
---|
34 | <body> |
---|
35 | <div class="header"> |
---|
36 | <div class="wrap"> |
---|
37 | <h1 id="logo"><a href="../../../index.html">GeoExt</a></h1> |
---|
38 | <ul id="top-nav"> |
---|
39 | <li class="first"><a href="../../../docs.html">Documentation</a></li> |
---|
40 | <li><a href="../../../examples.html">Examples</a></li> |
---|
41 | <li><a href="../../../downloads.html">Download</a></li> |
---|
42 | <li><a href="http://trac.geoext.org/">Development</a></li> |
---|
43 | </ul> |
---|
44 | <div id="searchbox"> |
---|
45 | <form class="search" action="../../../search.html" method="get"> |
---|
46 | <input id="searchbox-query" type="text" name="q" size="25" value="Search …" tabindex="3" onblur="if(this.value=='') this.value='Search …';" onfocus="if(this.value=='Search …') this.value='';" /> |
---|
47 | <input id="searchbox-submit" type="image" value="Search" src="../../../_static/img/search_icon_green.png" /> |
---|
48 | <input type="hidden" name="check_keywords" value="yes" /> |
---|
49 | <input type="hidden" name="area" value="default" /> |
---|
50 | </form> |
---|
51 | </div> |
---|
52 | </div> |
---|
53 | </div> |
---|
54 | |
---|
55 | <div class="related"> |
---|
56 | <h3>Navigation</h3> |
---|
57 | <ul> |
---|
58 | <li><a href="../../../index.html">GeoExt</a> »</li> |
---|
59 | <li><a href="../../index.html" >API Reference</a> »</li> |
---|
60 | <li><a href="../plugins.html" accesskey="U"><tt class="docutils literal docutils literal docutils literal docutils literal docutils literal"><span class="pre">GeoExt.plugins</span></tt></a> »</li> |
---|
61 | <li><a href="#"><tt class="docutils literal docutils literal"><span class="pre">GeoExt.plugins.PrintExtent</span></tt></a></li> |
---|
62 | </ul> |
---|
63 | </div> |
---|
64 | |
---|
65 | <div class="sphinxsidebar"> |
---|
66 | <div class="sphinxsidebarwrapper"> |
---|
67 | <h3><a href="../../../index.html">Table Of Contents</a></h3> |
---|
68 | <ul> |
---|
69 | <li><a class="reference external" href="#"><tt class="docutils literal"><span class="pre">GeoExt.plugins.PrintExtent</span></tt></a><ul> |
---|
70 | <li><a class="reference external" href="#example-use">Example Use</a></li> |
---|
71 | <li><a class="reference external" href="#config-options">Config Options</a></li> |
---|
72 | <li><a class="reference external" href="#public-properties">Public Properties</a></li> |
---|
73 | <li><a class="reference external" href="#public-methods">Public Methods</a></li> |
---|
74 | <li><a class="reference external" href="#events">Events</a></li> |
---|
75 | </ul> |
---|
76 | </li> |
---|
77 | </ul> |
---|
78 | |
---|
79 | <h4>Previous topic</h4> |
---|
80 | <p class="topless"><a href="AttributeForm.html" |
---|
81 | title="previous chapter"><tt class="docutils literal docutils literal docutils literal"><span class="pre">GeoExt.plugins.AttributeForm</span></tt></a></p> |
---|
82 | <h4>Next topic</h4> |
---|
83 | <p class="topless"><a href="PrintPageField.html" |
---|
84 | title="next chapter"><tt class="docutils literal"><span class="pre">GeoExt.plugins.PrintPageField</span></tt></a></p> |
---|
85 | </div> |
---|
86 | </div> |
---|
87 | |
---|
88 | |
---|
89 | <div class="document"> |
---|
90 | <div class="documentwrapper"> |
---|
91 | <div class="bodywrapper"> |
---|
92 | <div class="body"> |
---|
93 | |
---|
94 | <div class="section" id="geoext-plugins-printextent"> |
---|
95 | <h1><a title="GeoExt.plugins.PrintExtent" class="reference internal" href="#GeoExt.plugins.PrintExtent"><tt class="xref docutils literal"><span class="pre">GeoExt.plugins.PrintExtent</span></tt></a><a class="headerlink" href="#geoext-plugins-printextent" title="Permalink to this headline">¶</a></h1> |
---|
96 | <dl class="meta docutils"> |
---|
97 | <dt>ptype</dt> |
---|
98 | <dd><tt class="docutils literal"><span class="pre">gx_printextent</span></tt></dd> |
---|
99 | </dl> |
---|
100 | <dl class="class"> |
---|
101 | <dt id="GeoExt.plugins.PrintExtent"> |
---|
102 | <em class="property">class </em><tt class="descclassname">GeoExt.plugins.</tt><tt class="descname">PrintExtent</tt><a class="headerlink" href="#GeoExt.plugins.PrintExtent" title="Permalink to this definition">¶</a></dt> |
---|
103 | <dd></dd></dl> |
---|
104 | |
---|
105 | <p>Provides a way to show and modify the extents of print pages on the map. It |
---|
106 | uses a layer to render the page extent and handle features of print pages, |
---|
107 | and provides a control to modify them. Must be set as a plugin to a |
---|
108 | <a title="GeoExt.MapPanel" class="reference external" href="../widgets/MapPanel.html#GeoExt.MapPanel"><tt class="xref docutils literal"><span class="pre">GeoExt.MapPanel</span></tt></a>.</p> |
---|
109 | <div class="section" id="example-use"> |
---|
110 | <h2>Example Use<a class="headerlink" href="#example-use" title="Permalink to this headline">¶</a></h2> |
---|
111 | <p>Sample code to create a MapPanel with a PrintExtent, and print it |
---|
112 | immediately:</p> |
---|
113 | <div class="highlight-javascript"><div class="highlight"><pre><span class="kd">var</span> <span class="nx">printExtent</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">GeoExt</span><span class="p">.</span><span class="nx">plugins</span><span class="p">.</span><span class="nx">PrintExtent</span><span class="p">({</span> |
---|
114 | <span class="nx">printProvider</span><span class="o">:</span> <span class="k">new</span> <span class="nx">GeoExt</span><span class="p">.</span><span class="nx">data</span><span class="p">.</span><span class="nx">PrintProvider</span><span class="p">({</span> |
---|
115 | <span class="nx">capabilities</span><span class="o">:</span> <span class="nx">printCapabilities</span> |
---|
116 | <span class="p">})</span> |
---|
117 | <span class="p">});</span> |
---|
118 | |
---|
119 | <span class="kd">var</span> <span class="nx">mapPanel</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">GeoExt</span><span class="p">.</span><span class="nx">MapPanel</span><span class="p">({</span> |
---|
120 | <span class="nx">border</span><span class="o">:</span> <span class="kc">false</span><span class="p">,</span> |
---|
121 | <span class="nx">renderTo</span><span class="o">:</span> <span class="s2">"div-id"</span><span class="p">,</span> |
---|
122 | <span class="nx">layers</span><span class="o">:</span> <span class="p">[</span><span class="k">new</span> <span class="nx">OpenLayers</span><span class="p">.</span><span class="nx">Layer</span><span class="p">.</span><span class="nx">WMS</span><span class="p">(</span><span class="s2">"Tasmania"</span><span class="p">,</span> <span class="s2">"http://demo.opengeo.org/geoserver/wms"</span><span class="p">,</span> |
---|
123 | <span class="p">{</span><span class="nx">layers</span><span class="o">:</span> <span class="s2">"topp:tasmania_state_boundaries"</span><span class="p">},</span> <span class="p">{</span><span class="nx">singleTile</span><span class="o">:</span> <span class="kc">true</span><span class="p">})],</span> |
---|
124 | <span class="nx">center</span><span class="o">:</span> <span class="p">[</span><span class="mf">146.56</span><span class="p">,</span> <span class="o">-</span><span class="mf">41.56</span><span class="p">],</span> |
---|
125 | <span class="nx">zoom</span><span class="o">:</span> <span class="mi">6</span><span class="p">,</span> |
---|
126 | <span class="nx">plugins</span><span class="o">:</span> <span class="nx">printExtent</span> |
---|
127 | <span class="p">});</span> |
---|
128 | |
---|
129 | <span class="nx">printExtent</span><span class="p">.</span><span class="nx">addPage</span><span class="p">();</span> |
---|
130 | |
---|
131 | <span class="c1">// print the map</span> |
---|
132 | <span class="nx">printExtent</span><span class="p">.</span><span class="nx">print</span><span class="p">();</span> |
---|
133 | </pre></div> |
---|
134 | </div> |
---|
135 | </div> |
---|
136 | <div class="section" id="config-options"> |
---|
137 | <h2>Config Options<a class="headerlink" href="#config-options" title="Permalink to this headline">¶</a></h2> |
---|
138 | <p>Configuration properties.</p> |
---|
139 | <dl class="describe"> |
---|
140 | <dt> |
---|
141 | <tt class="descname">layer</tt></dt> |
---|
142 | <dd><tt class="docutils literal"><span class="pre">OpenLayers.Layer.Vector</span></tt> The layer used to render extent and handle |
---|
143 | features to. Optional, will be created if not provided.</dd></dl> |
---|
144 | |
---|
145 | <dl class="describe"> |
---|
146 | <dt> |
---|
147 | <tt class="descname">pages</tt></dt> |
---|
148 | <dd><p>Array of <a title="GeoExt.data.PrintPage" class="reference external" href="../data/PrintPage.html#GeoExt.data.PrintPage"><tt class="xref docutils literal"><span class="pre">GeoExt.data.PrintPage</span></tt></a> The pages that this plugin |
---|
149 | controls. Optional. If not provided, it will be created with one page |
---|
150 | that is completely contained within the visible map extent.</p> |
---|
151 | <div class="admonition note"> |
---|
152 | <p class="first admonition-title">Note</p> |
---|
153 | <p class="last">All pages must use the same PrintProvider.</p> |
---|
154 | </div> |
---|
155 | </dd></dl> |
---|
156 | |
---|
157 | <dl class="describe"> |
---|
158 | <dt> |
---|
159 | <tt class="descname">printProvider</tt></dt> |
---|
160 | <dd><a title="GeoExt.data.PrintProvider" class="reference external" href="../data/PrintProvider.html#GeoExt.data.PrintProvider"><tt class="xref docutils literal"><span class="pre">GeoExt.data.PrintProvider</span></tt></a> The print provider this form |
---|
161 | is connected to. Optional if pages are provided.</dd></dl> |
---|
162 | |
---|
163 | </div> |
---|
164 | <div class="section" id="public-properties"> |
---|
165 | <h2>Public Properties<a class="headerlink" href="#public-properties" title="Permalink to this headline">¶</a></h2> |
---|
166 | <p>Public properties.</p> |
---|
167 | <dl class="attribute"> |
---|
168 | <dt id="GeoExt.plugins.PrintExtent.page"> |
---|
169 | <tt class="descclassname">PrintExtent.</tt><tt class="descname">page</tt><a class="headerlink" href="#GeoExt.plugins.PrintExtent.page" title="Permalink to this definition">¶</a></dt> |
---|
170 | <dd><a title="GeoExt.data.PrintPage" class="reference external" href="../data/PrintPage.html#GeoExt.data.PrintPage"><tt class="xref docutils literal"><span class="pre">GeoExt.data.PrintPage</span></tt></a> The page currently set for |
---|
171 | transformation.</dd></dl> |
---|
172 | |
---|
173 | <dl class="attribute"> |
---|
174 | <dt id="GeoExt.plugins.PrintExtent.pages"> |
---|
175 | <tt class="descclassname">PrintExtent.</tt><tt class="descname">pages</tt><a class="headerlink" href="#GeoExt.plugins.PrintExtent.pages" title="Permalink to this definition">¶</a></dt> |
---|
176 | <dd>Array of <a title="GeoExt.data.PrintPage" class="reference external" href="../data/PrintPage.html#GeoExt.data.PrintPage"><tt class="xref docutils literal"><span class="pre">GeoExt.data.PrintPage</span></tt></a> The pages that this component |
---|
177 | controls. Read-only.</dd></dl> |
---|
178 | |
---|
179 | <dl class="attribute"> |
---|
180 | <dt id="GeoExt.plugins.PrintExtent.printProvider"> |
---|
181 | <tt class="descclassname">PrintExtent.</tt><tt class="descname">printProvider</tt><a class="headerlink" href="#GeoExt.plugins.PrintExtent.printProvider" title="Permalink to this definition">¶</a></dt> |
---|
182 | <dd><a title="GeoExt.data.PrintProvider" class="reference external" href="../data/PrintProvider.html#GeoExt.data.PrintProvider"><tt class="xref docutils literal"><span class="pre">GeoExt.data.PrintProvider</span></tt></a> The print provider this form |
---|
183 | is connected to. Read-only.</dd></dl> |
---|
184 | |
---|
185 | </div> |
---|
186 | <div class="section" id="public-methods"> |
---|
187 | <h2>Public Methods<a class="headerlink" href="#public-methods" title="Permalink to this headline">¶</a></h2> |
---|
188 | <p>Public methods.</p> |
---|
189 | <dl class="method"> |
---|
190 | <dt id="GeoExt.plugins.PrintExtent.addPage"> |
---|
191 | <tt class="descclassname">PrintExtent.</tt><tt class="descname">addPage</tt><big>(</big><big>)</big><a class="headerlink" href="#GeoExt.plugins.PrintExtent.addPage" title="Permalink to this definition">¶</a></dt> |
---|
192 | <dd><table class="docutils field-list" frame="void" rules="none"> |
---|
193 | <col class="field-name" /> |
---|
194 | <col class="field-body" /> |
---|
195 | <tbody valign="top"> |
---|
196 | <tr class="field"><th class="field-name">Parameter:</th><td class="field-body"><em>page</em> – <a title="GeoExt.data.PrintPage" class="reference external" href="../data/PrintPage.html#GeoExt.data.PrintPage"><tt class="xref docutils literal"><span class="pre">GeoExt.data.PrintPage</span></tt></a> The page to add |
---|
197 | to this plugin. If not provided, a page that fits the current |
---|
198 | extent is created.</td> |
---|
199 | </tr> |
---|
200 | <tr class="field"><th class="field-name">Returns:</th><td class="field-body">page :class:<tt class="docutils literal"><span class="pre">GeoExt.data.PrintPage</span></tt></td> |
---|
201 | </tr> |
---|
202 | </tbody> |
---|
203 | </table> |
---|
204 | <p>Adds a page to the list of pages that this plugin controls.</p> |
---|
205 | </dd></dl> |
---|
206 | |
---|
207 | <dl class="method"> |
---|
208 | <dt id="GeoExt.plugins.PrintExtent.hide"> |
---|
209 | <tt class="descclassname">PrintExtent.</tt><tt class="descname">hide</tt><big>(</big><big>)</big><a class="headerlink" href="#GeoExt.plugins.PrintExtent.hide" title="Permalink to this definition">¶</a></dt> |
---|
210 | <dd>Tear downs the plugin, removing the |
---|
211 | <tt class="docutils literal"><span class="pre">OpenLayers.Control.TransformFeature</span></tt> control and |
---|
212 | the <tt class="docutils literal"><span class="pre">OpenLayers.Layer.Vector</span></tt> layer.</dd></dl> |
---|
213 | |
---|
214 | <dl class="method"> |
---|
215 | <dt id="GeoExt.plugins.PrintExtent.print"> |
---|
216 | <tt class="descclassname">PrintExtent.</tt><tt class="descname">print</tt><big>(</big><big>)</big><a class="headerlink" href="#GeoExt.plugins.PrintExtent.print" title="Permalink to this definition">¶</a></dt> |
---|
217 | <dd><table class="docutils field-list" frame="void" rules="none"> |
---|
218 | <col class="field-name" /> |
---|
219 | <col class="field-body" /> |
---|
220 | <tbody valign="top"> |
---|
221 | <tr class="field"><th class="field-name">Parameter:</th><td class="field-body"><em>options</em> – <tt class="docutils literal"><span class="pre">Object</span></tt> Options to send to the PrintProvider’s |
---|
222 | print method. See <a title="GeoExt.data.PrintProvider" class="reference external" href="../data/PrintProvider.html#GeoExt.data.PrintProvider"><tt class="xref docutils literal"><span class="pre">GeoExt.data.PrintProvider</span></tt></a> :: <tt class="docutils literal"><span class="pre">print</span></tt>.</td> |
---|
223 | </tr> |
---|
224 | </tbody> |
---|
225 | </table> |
---|
226 | <p>Prints all pages as shown on the map.</p> |
---|
227 | </dd></dl> |
---|
228 | |
---|
229 | <dl class="method"> |
---|
230 | <dt id="GeoExt.plugins.PrintExtent.removePage"> |
---|
231 | <tt class="descclassname">PrintExtent.</tt><tt class="descname">removePage</tt><big>(</big><big>)</big><a class="headerlink" href="#GeoExt.plugins.PrintExtent.removePage" title="Permalink to this definition">¶</a></dt> |
---|
232 | <dd><table class="docutils field-list" frame="void" rules="none"> |
---|
233 | <col class="field-name" /> |
---|
234 | <col class="field-body" /> |
---|
235 | <tbody valign="top"> |
---|
236 | <tr class="field"><th class="field-name">Parameter:</th><td class="field-body"><em>page</em> – <a title="GeoExt.data.PrintPage" class="reference external" href="../data/PrintPage.html#GeoExt.data.PrintPage"><tt class="xref docutils literal"><span class="pre">GeoExt.data.PrintPage</span></tt></a> The page to remove |
---|
237 | from this plugin.</td> |
---|
238 | </tr> |
---|
239 | </tbody> |
---|
240 | </table> |
---|
241 | <p>Removes a page from the list of pages that this plugin controls.</p> |
---|
242 | </dd></dl> |
---|
243 | |
---|
244 | <dl class="method"> |
---|
245 | <dt id="GeoExt.plugins.PrintExtent.selectPage"> |
---|
246 | <tt class="descclassname">PrintExtent.</tt><tt class="descname">selectPage</tt><big>(</big><big>)</big><a class="headerlink" href="#GeoExt.plugins.PrintExtent.selectPage" title="Permalink to this definition">¶</a></dt> |
---|
247 | <dd><table class="docutils field-list" frame="void" rules="none"> |
---|
248 | <col class="field-name" /> |
---|
249 | <col class="field-body" /> |
---|
250 | <tbody valign="top"> |
---|
251 | <tr class="field"><th class="field-name">Parameter:</th><td class="field-body"><em>page</em> – <a title="GeoExt.data.PrintPage" class="reference external" href="../data/PrintPage.html#GeoExt.data.PrintPage"><tt class="xref docutils literal"><span class="pre">GeoExt.data.PrintPage</span></tt></a> The page to select</td> |
---|
252 | </tr> |
---|
253 | </tbody> |
---|
254 | </table> |
---|
255 | <p>Selects the given page (ie. calls the setFeature on the modify feature |
---|
256 | control)</p> |
---|
257 | </dd></dl> |
---|
258 | |
---|
259 | <dl class="method"> |
---|
260 | <dt id="GeoExt.plugins.PrintExtent.show"> |
---|
261 | <tt class="descclassname">PrintExtent.</tt><tt class="descname">show</tt><big>(</big><big>)</big><a class="headerlink" href="#GeoExt.plugins.PrintExtent.show" title="Permalink to this definition">¶</a></dt> |
---|
262 | <dd>Sets up the plugin, initializing the <tt class="docutils literal"><span class="pre">OpenLayers.Layer.Vector</span></tt> |
---|
263 | layer and <tt class="docutils literal"><span class="pre">OpenLayers.Control.TransformFeature</span></tt>, and centering |
---|
264 | the first page if no pages were specified in the configuration.</dd></dl> |
---|
265 | |
---|
266 | </div> |
---|
267 | <div class="section" id="events"> |
---|
268 | <h2>Events<a class="headerlink" href="#events" title="Permalink to this headline">¶</a></h2> |
---|
269 | <p>Events.</p> |
---|
270 | <dl class="describe"> |
---|
271 | <dt> |
---|
272 | <tt class="descname">selectpage</tt></dt> |
---|
273 | <dd><p>Triggered when a page has been selected using the control</p> |
---|
274 | <p>Listener arguments: |
---|
275 | * printPage - <a title="GeoExt.data.PrintPage" class="reference external" href="../data/PrintPage.html#GeoExt.data.PrintPage"><tt class="xref docutils literal"><span class="pre">GeoExt.data.PrintPage</span></tt></a> this printPage</p> |
---|
276 | </dd></dl> |
---|
277 | |
---|
278 | </div> |
---|
279 | </div> |
---|
280 | |
---|
281 | |
---|
282 | </div> |
---|
283 | </div> |
---|
284 | </div> |
---|
285 | <div class="clearer"></div> |
---|
286 | </div> |
---|
287 | <div class="related"> |
---|
288 | <h3>Navigation</h3> |
---|
289 | <ul> |
---|
290 | <li class="right" style="margin-right: 10px"> |
---|
291 | <a href="../../../genindex.html" title="General Index" |
---|
292 | accesskey="I">index</a></li> |
---|
293 | <li class="right" > |
---|
294 | <a href="../../../modindex.html" title="Global Module Index" |
---|
295 | accesskey="M">modules</a> |</li> |
---|
296 | <li class="right" > |
---|
297 | <a href="PrintPageField.html" title="GeoExt.plugins.PrintPageField" |
---|
298 | accesskey="N">next</a> |</li> |
---|
299 | <li class="right" > |
---|
300 | <a href="AttributeForm.html" title="GeoExt.plugins.AttributeForm" |
---|
301 | accesskey="P">previous</a> |</li> |
---|
302 | <li><a href="../../../index.html">GeoExt</a> »</li> |
---|
303 | <li><a href="../../index.html" >API Reference</a> »</li> |
---|
304 | <li><a href="../plugins.html" ><tt class="docutils literal docutils literal docutils literal docutils literal docutils literal"><span class="pre">GeoExt.plugins</span></tt></a> »</li> |
---|
305 | <li><a href="#"><tt class="docutils literal docutils literal"><span class="pre">GeoExt.plugins.PrintExtent</span></tt></a></li> |
---|
306 | </ul> |
---|
307 | </div> |
---|
308 | |
---|
309 | <div class="footer"> |
---|
310 | © Copyright 2009-2010, GeoExt Community. |
---|
311 | </div> |
---|
312 | </body> |
---|
313 | </html> |
---|