[76] | 1 | |
---|
| 2 | .. currentmodule:: GeoExt |
---|
| 3 | |
---|
| 4 | :class:`GeoExt.MapPanel` |
---|
| 5 | ================================================================================ |
---|
| 6 | |
---|
| 7 | |
---|
| 8 | .. cssclass:: meta |
---|
| 9 | |
---|
| 10 | |
---|
| 11 | Extends |
---|
| 12 | * `Ext.Panel <http://dev.sencha.com/deploy/dev/docs/?class=Ext.Panel>`_ |
---|
| 13 | |
---|
| 14 | |
---|
| 15 | |
---|
| 16 | |
---|
| 17 | xtype |
---|
| 18 | ``gx_mappanel`` |
---|
| 19 | |
---|
| 20 | |
---|
| 21 | |
---|
| 22 | |
---|
| 23 | .. class:: MapPanel(config) |
---|
| 24 | |
---|
| 25 | Create a panel container for a map. |
---|
| 26 | |
---|
| 27 | |
---|
| 28 | |
---|
| 29 | Example Use |
---|
| 30 | ----------- |
---|
| 31 | |
---|
| 32 | Sample code to create a panel with a new map: |
---|
| 33 | |
---|
| 34 | .. code-block:: javascript |
---|
| 35 | |
---|
| 36 | var mapPanel = new GeoExt.MapPanel({ |
---|
| 37 | border: false, |
---|
| 38 | renderTo: "div-id", |
---|
| 39 | map: { |
---|
| 40 | maxExtent: new OpenLayers.Bounds(-90, -45, 90, 45) |
---|
| 41 | } |
---|
| 42 | }); |
---|
| 43 | |
---|
| 44 | Sample code to create a map panel with a bottom toolbar in a Window: |
---|
| 45 | |
---|
| 46 | .. code-block:: javascript |
---|
| 47 | |
---|
| 48 | var win = new Ext.Window({ |
---|
| 49 | title: "My Map", |
---|
| 50 | items: [{ |
---|
| 51 | xtype: "gx_mappanel", |
---|
| 52 | bbar: new Ext.Toolbar() |
---|
| 53 | }] |
---|
| 54 | }); |
---|
| 55 | |
---|
| 56 | |
---|
| 57 | |
---|
| 58 | |
---|
| 59 | Config Options |
---|
| 60 | -------------- |
---|
| 61 | |
---|
| 62 | Configuration properties in addition to |
---|
| 63 | those listed for `Ext.Panel <http://dev.sencha.com/deploy/dev/docs/?class=Ext.Panel>`_. |
---|
| 64 | |
---|
| 65 | |
---|
| 66 | .. describe:: center |
---|
| 67 | |
---|
| 68 | ``OpenLayers.LonLat or Array(Number)`` A location for the map center. If |
---|
| 69 | an array is provided, the first two items should represent x & y coordinates. |
---|
| 70 | |
---|
| 71 | .. describe:: extent |
---|
| 72 | |
---|
| 73 | ``OpenLayers.Bounds or Array(Number)`` An initial extent for the map (used |
---|
| 74 | if center and zoom are not provided. If an array, the first four items |
---|
| 75 | should be minx, miny, maxx, maxy. |
---|
| 76 | |
---|
| 77 | .. describe:: layers |
---|
| 78 | |
---|
| 79 | ``GeoExt.data.LayerStore or GeoExt.data.GroupingStore or Array(OpenLayers.Layer)`` |
---|
| 80 | A store holding records. The layers provided here will be added to this |
---|
| 81 | MapPanel's map when it is rendered. |
---|
| 82 | |
---|
| 83 | .. describe:: map |
---|
| 84 | |
---|
| 85 | ``OpenLayers.Map or Object`` A configured map or a configuration object |
---|
| 86 | for the map constructor. A configured map will be available after |
---|
| 87 | construction through the :attr:`map` property. |
---|
| 88 | |
---|
| 89 | .. describe:: prettyStateKeys |
---|
| 90 | |
---|
| 91 | ``Boolean`` Set this to true if you want pretty strings in the MapPanel's |
---|
| 92 | state keys. More specifically, layer.name instead of layer.id will be used |
---|
| 93 | in the state keys if this option is set to true. But in that case you have |
---|
| 94 | to make sure you don't have two layers with the same name. Defaults to |
---|
| 95 | false. |
---|
| 96 | |
---|
| 97 | .. describe:: zoom |
---|
| 98 | |
---|
| 99 | ``Number`` An initial zoom level for the map. |
---|
| 100 | |
---|
| 101 | |
---|
| 102 | |
---|
| 103 | |
---|
| 104 | Public Properties |
---|
| 105 | ----------------- |
---|
| 106 | |
---|
| 107 | Public properties in addition to those |
---|
| 108 | listed for `Ext.Panel <http://dev.sencha.com/deploy/dev/docs/?class=Ext.Panel>`_. |
---|
| 109 | |
---|
| 110 | |
---|
| 111 | .. attribute:: MapPanel.layers |
---|
| 112 | |
---|
| 113 | :class:`GeoExt.data.LayerStore` A store containing |
---|
| 114 | :class:`GeoExt.data.LayerRecord` objects. |
---|
| 115 | |
---|
| 116 | .. attribute:: MapPanel.map |
---|
| 117 | |
---|
| 118 | ``OpenLayers.Map`` or ``Object`` A map or map configuration. |
---|
| 119 | |
---|
| 120 | |
---|
| 121 | |
---|
| 122 | |
---|
| 123 | |
---|
| 124 | |
---|
| 125 | |
---|