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.LayerOpacitySlider — 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="Widgets" href="../widgets.html" /> |
---|
25 | <link rel="next" title="GeoExt.LegendImage" href="LegendImage.html" /> |
---|
26 | <link rel="prev" title="GeoExt.LayerLegend" href="LayerLegend.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="../widgets.html" accesskey="U">Widgets</a> »</li> |
---|
61 | <li><a href="#"><tt class="docutils literal docutils literal"><span class="pre">GeoExt.LayerOpacitySlider</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.LayerOpacitySlider</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-methods">Public Methods</a></li> |
---|
73 | </ul> |
---|
74 | </li> |
---|
75 | </ul> |
---|
76 | |
---|
77 | <h4>Previous topic</h4> |
---|
78 | <p class="topless"><a href="LayerLegend.html" |
---|
79 | title="previous chapter"><tt class="docutils literal docutils literal docutils literal"><span class="pre">GeoExt.LayerLegend</span></tt></a></p> |
---|
80 | <h4>Next topic</h4> |
---|
81 | <p class="topless"><a href="LegendImage.html" |
---|
82 | title="next chapter"><tt class="docutils literal"><span class="pre">GeoExt.LegendImage</span></tt></a></p> |
---|
83 | </div> |
---|
84 | </div> |
---|
85 | |
---|
86 | |
---|
87 | <div class="document"> |
---|
88 | <div class="documentwrapper"> |
---|
89 | <div class="bodywrapper"> |
---|
90 | <div class="body"> |
---|
91 | |
---|
92 | <div class="section" id="geoext-layeropacityslider"> |
---|
93 | <h1><a title="GeoExt.LayerOpacitySlider" class="reference internal" href="#GeoExt.LayerOpacitySlider"><tt class="xref docutils literal"><span class="pre">GeoExt.LayerOpacitySlider</span></tt></a><a class="headerlink" href="#geoext-layeropacityslider" title="Permalink to this headline">¶</a></h1> |
---|
94 | <dl class="meta docutils"> |
---|
95 | <dt>Extends</dt> |
---|
96 | <dd><ul class="first last simple"> |
---|
97 | <li><a class="reference external" href="http://dev.sencha.com/deploy/dev/docs/?class=Ext.Slider">Ext.Slider</a></li> |
---|
98 | </ul> |
---|
99 | </dd> |
---|
100 | <dt>xtype</dt> |
---|
101 | <dd><tt class="docutils literal"><span class="pre">gx_opacityslider</span></tt></dd> |
---|
102 | </dl> |
---|
103 | <dl class="class"> |
---|
104 | <dt id="GeoExt.LayerOpacitySlider"> |
---|
105 | <em class="property">class </em><tt class="descclassname">GeoExt.</tt><tt class="descname">LayerOpacitySlider</tt><big>(</big><em>config</em><big>)</big><a class="headerlink" href="#GeoExt.LayerOpacitySlider" title="Permalink to this definition">¶</a></dt> |
---|
106 | <dd>Create a slider for controlling a layer’s opacity.</dd></dl> |
---|
107 | |
---|
108 | <div class="section" id="example-use"> |
---|
109 | <h2>Example Use<a class="headerlink" href="#example-use" title="Permalink to this headline">¶</a></h2> |
---|
110 | <p>Sample code to render a slider outside the map viewport:</p> |
---|
111 | <div class="highlight-javascript"><div class="highlight"><pre><span class="kd">var</span> <span class="nx">slider</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">GeoExt</span><span class="p">.</span><span class="nx">LayerOpacitySlider</span><span class="p">({</span> |
---|
112 | <span class="nx">renderTo</span><span class="o">:</span> <span class="nb">document</span><span class="p">.</span><span class="nx">body</span><span class="p">,</span> |
---|
113 | <span class="nx">width</span><span class="o">:</span> <span class="mi">200</span><span class="p">,</span> |
---|
114 | <span class="nx">layer</span><span class="o">:</span> <span class="nx">layer</span> |
---|
115 | <span class="p">});</span> |
---|
116 | </pre></div> |
---|
117 | </div> |
---|
118 | <p>Sample code to add a slider to a map panel:</p> |
---|
119 | <div class="highlight-javascript"><div class="highlight"><pre><span class="kd">var</span> <span class="nx">layer</span> <span class="o">=</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> |
---|
120 | <span class="s2">"Global Imagery"</span><span class="p">,</span> |
---|
121 | <span class="s2">"http://maps.opengeo.org/geowebcache/service/wms"</span><span class="p">,</span> |
---|
122 | <span class="p">{</span><span class="nx">layers</span><span class="o">:</span> <span class="s2">"bluemarble"</span><span class="p">}</span> |
---|
123 | <span class="p">);</span> |
---|
124 | <span class="kd">var</span> <span class="nx">panel</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> |
---|
125 | <span class="nx">renderTo</span><span class="o">:</span> <span class="nb">document</span><span class="p">.</span><span class="nx">body</span><span class="p">,</span> |
---|
126 | <span class="nx">height</span><span class="o">:</span> <span class="mi">300</span><span class="p">,</span> |
---|
127 | <span class="nx">width</span><span class="o">:</span> <span class="mi">400</span><span class="p">,</span> |
---|
128 | <span class="nx">map</span><span class="o">:</span> <span class="p">{</span> |
---|
129 | <span class="nx">controls</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">Control</span><span class="p">.</span><span class="nx">Navigation</span><span class="p">()]</span> |
---|
130 | <span class="p">},</span> |
---|
131 | <span class="nx">layers</span><span class="o">:</span> <span class="p">[</span><span class="nx">layer</span><span class="p">],</span> |
---|
132 | <span class="nx">extent</span><span class="o">:</span> <span class="p">[</span><span class="o">-</span><span class="mi">5</span><span class="p">,</span> <span class="mi">35</span><span class="p">,</span> <span class="mi">15</span><span class="p">,</span> <span class="mi">55</span><span class="p">],</span> |
---|
133 | <span class="nx">items</span><span class="o">:</span> <span class="p">[{</span> |
---|
134 | <span class="nx">xtype</span><span class="o">:</span> <span class="s2">"gx_opacityslider"</span><span class="p">,</span> |
---|
135 | <span class="nx">layer</span><span class="o">:</span> <span class="nx">layer</span><span class="p">,</span> |
---|
136 | <span class="nx">aggressive</span><span class="o">:</span> <span class="kc">true</span><span class="p">,</span> |
---|
137 | <span class="nx">vertical</span><span class="o">:</span> <span class="kc">true</span><span class="p">,</span> |
---|
138 | <span class="nx">height</span><span class="o">:</span> <span class="mi">100</span><span class="p">,</span> |
---|
139 | <span class="nx">x</span><span class="o">:</span> <span class="mi">10</span><span class="p">,</span> |
---|
140 | <span class="nx">y</span><span class="o">:</span> <span class="mi">20</span> |
---|
141 | <span class="p">}]</span> |
---|
142 | <span class="p">});</span> |
---|
143 | </pre></div> |
---|
144 | </div> |
---|
145 | </div> |
---|
146 | <div class="section" id="config-options"> |
---|
147 | <h2>Config Options<a class="headerlink" href="#config-options" title="Permalink to this headline">¶</a></h2> |
---|
148 | <p>Configuration properties in addition to |
---|
149 | those listed for <a class="reference external" href="http://dev.sencha.com/deploy/dev/docs/?class=Ext.Slider">Ext.Slider</a>.</p> |
---|
150 | <dl class="describe"> |
---|
151 | <dt> |
---|
152 | <tt class="descname">aggressive</tt></dt> |
---|
153 | <dd><tt class="docutils literal"><span class="pre">Boolean</span></tt> |
---|
154 | If set to true, the opacity is changed as soon as the thumb is moved. |
---|
155 | Otherwise when the thumb is released (default).</dd></dl> |
---|
156 | |
---|
157 | <dl class="describe"> |
---|
158 | <dt> |
---|
159 | <tt class="descname">changeVisibility</tt></dt> |
---|
160 | <dd><tt class="docutils literal"><span class="pre">Boolean</span></tt> |
---|
161 | If set to true, the layer’s visibility is handled by the |
---|
162 | slider, the slider makes the layer invisible when its |
---|
163 | value is changed to the min value, and makes the layer |
---|
164 | visible again when its value goes from the min value |
---|
165 | to some other value. The layer passed to the constructor |
---|
166 | must be visible, as its visibility is fully handled by |
---|
167 | the slider. Defaults to false.</dd></dl> |
---|
168 | |
---|
169 | <dl class="describe"> |
---|
170 | <dt> |
---|
171 | <tt class="descname">changeVisibilityDelay</tt></dt> |
---|
172 | <dd><tt class="docutils literal"><span class="pre">Number</span></tt> Time in milliseconds before changing the layer’s visibility. |
---|
173 | If the value changes again within that time, the layer’s visibility |
---|
174 | change does not occur. Only applicable if changeVisibility is true. |
---|
175 | Defaults to 5.</dd></dl> |
---|
176 | |
---|
177 | <dl class="describe"> |
---|
178 | <dt> |
---|
179 | <tt class="descname">complementaryLayer</tt></dt> |
---|
180 | <dd><tt class="docutils literal"><span class="pre">OpenLayers.Layer</span></tt> or <a title="GeoExt.data.LayerRecord" class="reference external" href="../data/LayerRecord.html#GeoExt.data.LayerRecord"><tt class="xref docutils literal"><span class="pre">GeoExt.data.LayerRecord</span></tt></a> |
---|
181 | If provided, a layer that will be made invisible (its visibility is |
---|
182 | set to false) when the slider value is set to its max value. If this |
---|
183 | slider is used to fade visibility between to layers, setting |
---|
184 | <tt class="docutils literal"><span class="pre">complementaryLayer</span></tt> and <tt class="docutils literal"><span class="pre">changeVisibility</span></tt> will make sure that |
---|
185 | only visible tiles are loaded when the slider is set to its min or max |
---|
186 | value. (optional)</dd></dl> |
---|
187 | |
---|
188 | <dl class="describe"> |
---|
189 | <dt> |
---|
190 | <tt class="descname">delay</tt></dt> |
---|
191 | <dd><tt class="docutils literal"><span class="pre">Number</span></tt> Time in milliseconds before setting the opacity value to the |
---|
192 | layer. If the value change again within that time, the original value |
---|
193 | is not set. Only applicable if aggressive is true.</dd></dl> |
---|
194 | |
---|
195 | <dl class="describe"> |
---|
196 | <dt> |
---|
197 | <tt class="descname">inverse</tt></dt> |
---|
198 | <dd><tt class="docutils literal"><span class="pre">Boolean</span></tt> |
---|
199 | If true, we will work with transparency instead of with opacity. |
---|
200 | Defaults to false.</dd></dl> |
---|
201 | |
---|
202 | <dl class="describe"> |
---|
203 | <dt> |
---|
204 | <tt class="descname">layer</tt></dt> |
---|
205 | <dd><tt class="docutils literal"><span class="pre">OpenLayers.Layer</span></tt> or <a title="GeoExt.data.LayerRecord" class="reference external" href="../data/LayerRecord.html#GeoExt.data.LayerRecord"><tt class="xref docutils literal"><span class="pre">GeoExt.data.LayerRecord</span></tt></a> |
---|
206 | The layer this slider changes the opacity of. (required)</dd></dl> |
---|
207 | |
---|
208 | <dl class="describe"> |
---|
209 | <dt> |
---|
210 | <tt class="descname">value</tt></dt> |
---|
211 | <dd><tt class="docutils literal"><span class="pre">Number</span></tt> |
---|
212 | The value to initialize the slider with. This value is |
---|
213 | taken into account only if the layer’s opacity is null. |
---|
214 | If the layer’s opacity is null and this value is not |
---|
215 | defined in the config object then the slider initializes |
---|
216 | it to the max value.</dd></dl> |
---|
217 | |
---|
218 | </div> |
---|
219 | <div class="section" id="public-methods"> |
---|
220 | <h2>Public Methods<a class="headerlink" href="#public-methods" title="Permalink to this headline">¶</a></h2> |
---|
221 | <p>Public methods in addition to those |
---|
222 | listed for <a class="reference external" href="http://dev.sencha.com/deploy/dev/docs/?class=Ext.Slider">Ext.Slider</a>.</p> |
---|
223 | <dl class="method"> |
---|
224 | <dt id="GeoExt.LayerOpacitySlider.setLayer"> |
---|
225 | <tt class="descclassname">LayerOpacitySlider.</tt><tt class="descname">setLayer</tt><big>(</big><big>)</big><a class="headerlink" href="#GeoExt.LayerOpacitySlider.setLayer" title="Permalink to this definition">¶</a></dt> |
---|
226 | <dd><table class="docutils field-list" frame="void" rules="none"> |
---|
227 | <col class="field-name" /> |
---|
228 | <col class="field-body" /> |
---|
229 | <tbody valign="top"> |
---|
230 | <tr class="field"><th class="field-name">Parameter:</th><td class="field-body"><em>layer</em> – <tt class="docutils literal"><span class="pre">OpenLayers.Layer</span></tt> or <a title="GeoExt.data.LayerRecord" class="reference external" href="../data/LayerRecord.html#GeoExt.data.LayerRecord"><tt class="xref docutils literal"><span class="pre">GeoExt.data.LayerRecord</span></tt></a></td> |
---|
231 | </tr> |
---|
232 | </tbody> |
---|
233 | </table> |
---|
234 | <p>Bind a new layer to the opacity slider.</p> |
---|
235 | </dd></dl> |
---|
236 | |
---|
237 | </div> |
---|
238 | </div> |
---|
239 | |
---|
240 | |
---|
241 | </div> |
---|
242 | </div> |
---|
243 | </div> |
---|
244 | <div class="clearer"></div> |
---|
245 | </div> |
---|
246 | <div class="related"> |
---|
247 | <h3>Navigation</h3> |
---|
248 | <ul> |
---|
249 | <li class="right" style="margin-right: 10px"> |
---|
250 | <a href="../../../genindex.html" title="General Index" |
---|
251 | accesskey="I">index</a></li> |
---|
252 | <li class="right" > |
---|
253 | <a href="../../../modindex.html" title="Global Module Index" |
---|
254 | accesskey="M">modules</a> |</li> |
---|
255 | <li class="right" > |
---|
256 | <a href="LegendImage.html" title="GeoExt.LegendImage" |
---|
257 | accesskey="N">next</a> |</li> |
---|
258 | <li class="right" > |
---|
259 | <a href="LayerLegend.html" title="GeoExt.LayerLegend" |
---|
260 | accesskey="P">previous</a> |</li> |
---|
261 | <li><a href="../../../index.html">GeoExt</a> »</li> |
---|
262 | <li><a href="../../index.html" >API Reference</a> »</li> |
---|
263 | <li><a href="../widgets.html" >Widgets</a> »</li> |
---|
264 | <li><a href="#"><tt class="docutils literal docutils literal"><span class="pre">GeoExt.LayerOpacitySlider</span></tt></a></li> |
---|
265 | </ul> |
---|
266 | </div> |
---|
267 | |
---|
268 | <div class="footer"> |
---|
269 | © Copyright 2009-2010, GeoExt Community. |
---|
270 | </div> |
---|
271 | </body> |
---|
272 | </html> |
---|