source:
trunk/workshop-routing-foss4g/web/GeoExt/docs/_sources/lib/GeoExt/data/LayerStore.txt
@
76
Revision 76, 2.4 KB checked in by djay, 12 years ago (diff) | |
---|---|
|
Line | |
---|---|
1 | |
2 | .. currentmodule:: GeoExt.data |
3 | |
4 | :class:`GeoExt.data.LayerStore` |
5 | ================================================================================ |
6 | |
7 | |
8 | .. cssclass:: meta |
9 | |
10 | |
11 | Extends |
12 | * `Ext.data.Store <http://dev.sencha.com/deploy/dev/docs/?class=Ext.data.Store>`_ |
13 | |
14 | |
15 | |
16 | |
17 | |
18 | |
19 | |
20 | .. class:: LayerStore |
21 | |
22 | A store that contains a cache of :class:`GeoExt.data.LayerRecord` |
23 | objects. |
24 | |
25 | |
26 | |
27 | Example Use |
28 | ----------- |
29 | |
30 | Sample to create a new store containing a cache of |
31 | :class:`GeoExt.data.LayerRecord` instances derived from map layers. |
32 | |
33 | .. code-block:: javascript |
34 | |
35 | var store = new GeoExt.data.LayerStore({ |
36 | map: myMap, |
37 | layers: myLayers |
38 | }); |
39 | |
40 | |
41 | |
42 | |
43 | Config Options |
44 | -------------- |
45 | |
46 | Configuration properties in addition to |
47 | those listed for `Ext.data.Store <http://dev.sencha.com/deploy/dev/docs/?class=Ext.data.Store>`_. |
48 | |
49 | |
50 | .. describe:: fields |
51 | |
52 | ``Array`` |
53 | If provided a custom layer record type with additional fields will be |
54 | used. Default fields for every layer record are `layer` |
55 | (``OpenLayers.Layer``) `title` (``String``). The value of this option is |
56 | either a field definition objects as passed to the |
57 | :meth:`GeoExt.data.LayerRecord.create` function or a |
58 | :class:`GeoExt.data.LayerRecord` constructor created using |
59 | :meth:`GeoExt.data.LayerRecord.create`. |
60 | |
61 | .. describe:: initDir |
62 | |
63 | ``Number`` |
64 | Bitfields specifying the direction to use for the initial sync between |
65 | the map and the store, if set to 0 then no initial sync is done. |
66 | Defaults to ``GeoExt.data.LayerStore.MAP_TO_STORE|GeoExt.data.LayerStore.STORE_TO_MAP`` |
67 | |
68 | .. describe:: layers |
69 | |
70 | ``Array(OpenLayers.Layer)`` |
71 | Layers that will be added to the store (and the map, depending on the |
72 | value of the ``initDir`` option. |
73 | |
74 | .. describe:: map |
75 | |
76 | ``OpenLayers.Map`` |
77 | Map that this store will be in sync with. If not provided, the |
78 | store will not be bound to a map. |
79 | |
80 | .. describe:: reader |
81 | |
82 | ``Ext.data.DataReader`` The reader used to produce |
83 | :class:`GeoExt.data.LayerRecord` objects from ``OpenLayers.Layer`` |
84 | objects. If not provided, a :class:`GeoExt.data.LayerReader` will be |
85 | used. |
86 | |
87 | |
88 | |
89 | |
90 | Public Properties |
91 | ----------------- |
92 | |
93 | Public properties in addition to those |
94 | listed for `Ext.data.Store <http://dev.sencha.com/deploy/dev/docs/?class=Ext.data.Store>`_. |
95 | |
96 | |
97 | .. attribute:: LayerStore.map |
98 | |
99 | ``OpenLayers.Map`` |
100 | Map that the store is synchronized with, if any. |
101 | |
102 | |
103 | |
104 | |
105 | |
106 | |
107 |
Note: See TracBrowser
for help on using the repository browser.