[Commits] r391 - core/trunk/geoext/examples

commits at geoext.org commits at geoext.org
Wed Apr 15 08:59:58 CEST 2009


Author: elemoine
Date: 2009-04-15 08:59:58 +0200 (Wed, 15 Apr 2009)
New Revision: 391

Modified:
   core/trunk/geoext/examples/feature-grid.html
   core/trunk/geoext/examples/feature-grid.js
Log:
make the feature grid example look a bit nicer, no functional change


Modified: core/trunk/geoext/examples/feature-grid.html
===================================================================
--- core/trunk/geoext/examples/feature-grid.html	2009-04-15 06:36:41 UTC (rev 390)
+++ core/trunk/geoext/examples/feature-grid.html	2009-04-15 06:59:58 UTC (rev 391)
@@ -12,12 +12,14 @@
         <h1>Grid Panel configured with a GeoExt.data.FeatureStore</h1>
 
         <p>This example shows an Ext grid loaded with features read from a
-        GeoJSON document (data/summits.json). Because the layer and the store
-        are bound to each other, the features loaded into the store are
-        automatically added to the layer. See <a
-        href=feature-grid.js>feature-grid.js</a>.  </p>
+        GeoJSON document (data/summits.json).</p>
+        
+        <p>Because the layer and the store are bound to each other, the
+        features loaded into the store are automatically added to the
+        layer.</p>
 
-        <div id="grid" style="width:350px; height:270px; margin-top:10px;"></div>
-        <div id="map" style="width:600px; height:400px; border:solid;"></div>
+        <p>See <a href=feature-grid.js>feature-grid.js</a>.</p>
+
+        <div id="mainpanel"></div>
     </body>
 </html>

Modified: core/trunk/geoext/examples/feature-grid.js
===================================================================
--- core/trunk/geoext/examples/feature-grid.js	2009-04-15 06:36:41 UTC (rev 390)
+++ core/trunk/geoext/examples/feature-grid.js	2009-04-15 06:59:58 UTC (rev 391)
@@ -1,9 +1,9 @@
 Ext.BLANK_IMAGE_URL = "../../../../ext/resources/images/default/s.gif"
 
-var map, store, grid;
+var mapPanel, store, gridPanel, mainPanel;
 
 Ext.onReady(function() {
-    map = new OpenLayers.Map("map");
+    var map = new OpenLayers.Map();
     var wmsLayer = new OpenLayers.Layer.WMS(
         "vmap0",
         "http://labs.metacarta.com/wms/vmap0",
@@ -11,13 +11,19 @@
     );
     var vecLayer = new OpenLayers.Layer.Vector("vector");
     map.addLayers([wmsLayer, vecLayer]);
-    map.zoomToExtent(
-        OpenLayers.Bounds.fromString(
-            "3.131104,43.445435,9.7229,47.839966"
-        )
-    );
+
+    mapPanel = new GeoExt.MapPanel({
+        title: "Map",
+        region: "center",
+        height: 400,
+        width: 600,
+        map: map,
+        center: new OpenLayers.LonLat(5, 45),
+        zoom: 6
+    });
     
     store = new GeoExt.data.FeatureStore({
+        layer: vecLayer,
         fields: [
             {name: 'name', type: 'string'},
             {name: 'elevation', type: 'float'}
@@ -28,13 +34,13 @@
                 format: new OpenLayers.Format.GeoJSON()
             })
         }),
-        layer: vecLayer,
         autoLoad: true
     });
 
-    grid = new Ext.grid.GridPanel({
+    gridPanel = new Ext.grid.GridPanel({
+        title: "Feature Grid",
+        region: "east",
         store: store,
-        height: 260,
         width: 320,
         columns: [{
             header: "Name",
@@ -44,8 +50,15 @@
             header: "Elevation",
             width: 100,
             dataIndex: "elevation"
-        }],
-        renderTo: "grid"
+        }]
     });
+
+    mainPanel = new Ext.Panel({
+        renderTo: "mainpanel",
+        layout: "border",
+        height: 400,
+        width: 920,
+        items: [mapPanel, gridPanel]
+    });
 });
 



More information about the Commits mailing list