Bienvenue sur PostGIS.fr

Bienvenue sur PostGIS.fr , le site de la communauté des utilisateurs francophones de PostGIS.

PostGIS ajoute le support d'objets géographique à la base de données PostgreSQL. En effet, PostGIS "spatialise" le serverur PostgreSQL, ce qui permet de l'utiliser comme une base de données SIG.

Maintenu à jour, en fonction de nos disponibilités et des diverses sorties des outils que nous testons, nous vous proposons l'ensemble de nos travaux publiés en langue française.

source: trunk/workshop-routing-foss4g/web/GeoExt/docs/_sources/lib/GeoExt/widgets/PrintMapPanel.txt @ 76

Revision 76, 6.2 KB checked in by djay, 12 years ago (diff)

Ajout du répertoire web

  • Property svn:executable set to *
RevLine 
[76]1
2.. currentmodule:: GeoExt
3
4:class:`GeoExt.PrintMapPanel`
5================================================================================
6
7
8.. cssclass:: meta
9
10
11Extends
12    * `Ext.Panel <http://dev.sencha.com/deploy/dev/docs/?class=Ext.Panel>`_
13    * :class:`GeoExt.MapPanel`
14
15
16
17xtype
18    ``gx_printmappanel``
19
20
21
22
23.. class:: PrintMapPanel
24
25A map panel that controls scale and center of a print page. Based on the
26current view (i.e. layers and extent) of a source map, this panel will be
27sized according to the aspect ratio of the print page. As the user zooms
28and pans in the :class:`GeoExt.PrintMapPanel`, the print page will update
29its scale and center accordingly. If the scale on the print page changes
30(e.g. by setting it using a combo box with a
31:class:`GeoExt.plugins.PrintPageField`), the extent of the
32:class:`GeoExt.PrintMapPanel` will be updated to match the page bounds.
33
34.. note:: The ``zoom``, ``center`` and ``extent`` config options will have
35    no affect, as they will be determined by the ``sourceMap``.
36
37
38
39Example Use
40-----------
41
42A map with a "Print..." button. If clicked, a dialog containing a
43PrintMapPanel will open, with a "Create PDF" button.
44
45.. code-block:: javascript
46
47    var mapPanel = new GeoExt.MapPanel({
48        renderTo: "map",
49        layers: [new OpenLayers.Layer.WMS("Tasmania State Boundaries",
50            "http://demo.opengeo.org/geoserver/wms",
51            {layers: "topp:tasmania_state_boundaries"}, {singleTile: true})],
52        center: [146.56, -41.56],
53        zoom: 6,
54        bbar: [{
55            text: "Print...",
56            handler: function() {
57                var printDialog = new Ext.Window({
58                    autoHeight: true,
59                    width: 350,
60                    items: [new GeoExt.PrintMapPanel({
61                        sourceMap: mapPanel,
62                        printProvider: {
63                            capabilities: printCapabilities
64                        }
65                    })],
66                    bbar: [{
67                        text: "Create PDF",
68                        handler: function() {
69                            printDialog.items.get(0).print();
70                        }
71                    }]
72                });
73                printDialog.show();
74            }
75        }]
76    });
77
78   
79
80
81Config Options
82--------------
83
84Configuration properties in addition to
85those listed for `Ext.Panel <http://dev.sencha.com/deploy/dev/docs/?class=Ext.Panel>`_.
86
87
88.. describe:: center
89
90    ``OpenLayers.LonLat`` or ``Array(Number)``  A location for the map
91    center. Do not set, as this will be overridden with the ``sourceMap``
92    center.
93
94.. describe:: extent
95
96    ``OpenLayers.Bounds or Array(Number)``  An initial extent for the map.
97    Do not set, because the initial extent will be determined by the
98    ``sourceMap``.
99
100.. describe:: layers
101
102    ``GeoExt.data.LayerStore or GeoExt.data.GroupingStore or Array(OpenLayers.Layer)``
103    A store holding records. The layers provided here will be added to this
104    MapPanel's map when it is rendered.
105
106.. describe:: limitScales
107
108    ``Boolean`` If set to true, the printPage cannot be set to scales that
109    would generate a preview in this :class:`GeoExt.PrintMapPanel` with a
110    completely different extent than the one that would appear on the
111    printed map. Default is false.
112
113.. describe:: map
114
115    ``Object`` Optional configuration for the ``OpenLayers.Map`` object
116    that this PrintMapPanel creates. Useful e.g. to configure a map with a
117    custom set of controls, or to add a ``preaddlayer`` listener for
118    filtering out layer types that cannot be printed.
119
120.. describe:: prettyStateKeys
121
122    ``Boolean`` Set this to true if you want pretty strings in the MapPanel's
123    state keys. More specifically, layer.name instead of layer.id will be used
124    in the state keys if this option is set to true. But in that case you have
125    to make sure you don't have two layers with the same name. Defaults to
126    false.
127
128.. describe:: printProvider
129
130    :class:`GeoExt.data.PrintProvider` or ``Object`` PrintProvider to use
131    for printing. If an ``Object`` is provided, a new PrintProvider will
132    be created and configured with the object.
133   
134    .. note:: The PrintMapPanel requires the printProvider's capabilities
135      to be available upon initialization. This means that a PrintMapPanel
136      configured with an ``Object`` as ``printProvider`` will only work
137      when ``capabilities`` is provided in the printProvider's
138      configuration object. If ``printProvider`` is provided as an instance
139      of :class:`GeoExt.data.PrintProvider`, the capabilities must be
140      loaded before PrintMapPanel initialization.
141
142.. describe:: sourceMap
143
144    :class:`GeoExt.MapPanel` or ``OpenLayers.Map`` The map that is to be
145    printed.
146
147.. describe:: zoom
148
149    ``Number``  An initial zoom level for the map. Do not set, because the
150    initial extent will be determined by the ``sourceMap``.
151
152
153
154
155Public Properties
156-----------------
157
158Public properties in addition to those
159listed for `Ext.Panel <http://dev.sencha.com/deploy/dev/docs/?class=Ext.Panel>`_.
160
161
162.. attribute:: PrintMapPanel.layers
163
164    :class:`GeoExt.data.LayerStore`  A store containing
165    :class:`GeoExt.data.LayerRecord` objects.
166
167.. attribute:: PrintMapPanel.map
168
169    ``OpenLayers.Map`` or ``Object``  A map or map configuration.
170
171.. attribute:: PrintMapPanel.previewScales
172
173    ``Ext.data.Store`` A data store with a subset of the printProvider's
174    scales. By default, this contains all the scales of the printProvider.
175    If ``limitScales`` is set to true, it will only contain print scales
176    that can properly be previewed with this :class:`GeoExt.PrintMapPanel`.
177
178.. attribute:: PrintMapPanel.printPage
179
180    :class:`GeoExt.data.PrintPage` PrintPage for this PrintMapPanel.
181    Read-only.
182
183.. attribute:: PrintMapPanel.printProvider
184
185    :class:`GeoExt.data.PrintProvider` PrintProvider for this
186    PrintMapPanel.
187
188
189
190
191Public Methods
192--------------
193
194Public methods in addition to those
195listed for `Ext.Panel <http://dev.sencha.com/deploy/dev/docs/?class=Ext.Panel>`_.
196
197
198.. method:: PrintMapPanel.print
199
200    :param options: ``Object`` options for
201        the :class:`GeoExt.data.PrintProvider` :: ``print``  method.
202   
203    Convenience method for printing the map, without the need to
204    interact with the printProvider and printPage.
205
206
207
208
209
Note: See TracBrowser for help on using the repository browser.