source:
trunk/workshop-routing-foss4g/web/GeoExt/docs/_sources/lib/GeoExt/widgets/Action.txt
@
76
Revision 76, 1.4 KB checked in by djay, 12 years ago (diff) | |
---|---|
|
Line | |
---|---|
1 | |
2 | .. currentmodule:: GeoExt |
3 | |
4 | :class:`GeoExt.Action` |
5 | ================================================================================ |
6 | |
7 | |
8 | .. cssclass:: meta |
9 | |
10 | |
11 | Extends |
12 | * `Ext.Action <http://dev.sencha.com/deploy/dev/docs/?class=Ext.Action>`_ |
13 | |
14 | |
15 | |
16 | |
17 | |
18 | |
19 | |
20 | .. class:: Action(config) |
21 | |
22 | Create a GeoExt.Action instance. A GeoExt.Action is created |
23 | to insert an OpenLayers control in a toolbar as a button or |
24 | in a menu as a menu item. A GeoExt.Action instance can be |
25 | used like a regular Ext.Action, look at the Ext.Action API |
26 | doc for more detail. |
27 | |
28 | |
29 | |
30 | Example Use |
31 | ----------- |
32 | |
33 | Sample code to create a toolbar with an OpenLayers control into it. |
34 | |
35 | .. code-block:: javascript |
36 | |
37 | var action = new GeoExt.Action({ |
38 | text: "max extent", |
39 | control: new OpenLayers.Control.ZoomToMaxExtent(), |
40 | map: map |
41 | }); |
42 | var toolbar = new Ext.Toolbar([action]); |
43 | |
44 | |
45 | |
46 | |
47 | Config Options |
48 | -------------- |
49 | |
50 | Configuration properties in addition to |
51 | those listed for `Ext.Action <http://dev.sencha.com/deploy/dev/docs/?class=Ext.Action>`_. |
52 | |
53 | |
54 | .. describe:: control |
55 | |
56 | ``OpenLayers.Control`` The OpenLayers control wrapped in this action. |
57 | |
58 | .. describe:: map |
59 | |
60 | ``OpenLayers.Map`` The OpenLayers map that the control should be added |
61 | to. For controls that don't need to be added to a map or have already |
62 | been added to one, this config property may be omitted. |
63 | |
64 | |
65 | |
66 | |
67 | |
68 | |
69 | |
70 | |
71 |
Note: See TracBrowser
for help on using the repository browser.