[Commits] r1780 - sandbox/ahocevar/playground/trunk/geoext/examples

commits at geoext.org commits at geoext.org
Tue Jan 19 14:37:46 CET 2010


Author: ahocevar
Date: 2010-01-19 14:37:46 +0100 (Tue, 19 Jan 2010)
New Revision: 1780

Modified:
   sandbox/ahocevar/playground/trunk/geoext/examples/print-page.js
Log:
indentation fixes and improved readability

Modified: sandbox/ahocevar/playground/trunk/geoext/examples/print-page.js
===================================================================
--- sandbox/ahocevar/playground/trunk/geoext/examples/print-page.js	2010-01-19 10:47:03 UTC (rev 1779)
+++ sandbox/ahocevar/playground/trunk/geoext/examples/print-page.js	2010-01-19 13:37:46 UTC (rev 1780)
@@ -14,59 +14,59 @@
 
 var mapPanel, printPage;
 
- Ext.onReady(function() {
-     // The map we want to print
-     mapPanel = new GeoExt.MapPanel({
-         region: "center",
-         layers: [new OpenLayers.Layer.WMS("Tasmania", "http://demo.opengeo.org/geoserver/wms",
-             {layers: "topp:tasmania_state_boundaries"}, {singleTile: true})],
-         center: [146.56, -41.56],
-         zoom: 7
-     });
-     // The legend to optionally include on the printout
-     var legendPanel = new GeoExt.LegendPanel({
-         region: "west",
-         width: 150,
-         bodyStyle: "padding:5px",
-         layerStore: mapPanel.layers
-     });
-     
-     // The printProvider that connects us to the print service
-     var printProvider = new GeoExt.data.PrintProvider({
-         method: "GET", // "POST" recommended for production use
-         capabilities: printCapabilities // from the info.json script in the html
-     });
+Ext.onReady(function() {
+    // The printProvider that connects us to the print service
+    var printProvider = new GeoExt.data.PrintProvider({
+        method: "GET", // "POST" recommended for production use
+        capabilities: printCapabilities // from the info.json script in the html
+    });
+    // Our print page. Tells the PrintProvider about the scale and center of
+    // our page.
+    printPage = new GeoExt.data.PrintPage({
+        printProvider: printProvider,
+        customParams: {
+            mapTitle: "Printing Demo",
+            comment: "This is a simple map printed from GeoExt."
+        }
+    });
 
-     var includeLegend; // controlled by the "Include legend?" checkbox
+    // The map we want to print
+    mapPanel = new GeoExt.MapPanel({
+        region: "center",
+        layers: [new OpenLayers.Layer.WMS("Tasmania", "http://demo.opengeo.org/geoserver/wms",
+            {layers: "topp:tasmania_state_boundaries"}, {singleTile: true})],
+        center: [146.56, -41.56],
+        zoom: 7
+    });
+    // The legend to optionally include on the printout
+    var legendPanel = new GeoExt.LegendPanel({
+        region: "west",
+        width: 150,
+        bodyStyle: "padding:5px",
+        layerStore: mapPanel.layers
+    });
+    
+    var includeLegend; // controlled by the "Include legend?" checkbox
      
-     // The main panel
-     new Ext.Panel({
-         renderTo: "content",
-         layout: "border",
-         width: 700,
-         height: 420,
-         items: [mapPanel, legendPanel],
-         bbar: ["->", {
-             text: "Print",
-             handler: function() {
-                 // Our print page. Tells the PrintProvider about the scale and
-                 // center of our page.
-                 printPage = new GeoExt.data.PrintPage({
-                     printProvider: printProvider,
-                     customParams: {
-                         mapTitle: "Printing Demo",
-                         comment: "This is a simple map printed from GeoExt."
-                     }
-                 });
-                 // convenient way to fit the print page to the visible map area
-                 printPage.fit(mapPanel, true);
-                 // print the page, optionally including the legend
-                 printProvider.print(mapPanel, printPage, includeLegend && {legend: legendPanel});
-             }
-         }, {
-             xtype: "checkbox",
-             boxLabel: "Include legend?",
-             handler: function() {includeLegend = this.checked}
-         }]
-     });
+    // The main panel
+    new Ext.Panel({
+        renderTo: "content",
+        layout: "border",
+        width: 700,
+        height: 420,
+        items: [mapPanel, legendPanel],
+        bbar: ["->", {
+            text: "Print",
+            handler: function() {
+                // convenient way to fit the print page to the visible map area
+                printPage.fit(mapPanel, true);
+                // print the page, optionally including the legend
+                printProvider.print(mapPanel, printPage, includeLegend && {legend: legendPanel});
+            }
+        }, {
+            xtype: "checkbox",
+            boxLabel: "Include legend?",
+            handler: function() {includeLegend = this.checked}
+        }]
+    });
 });



More information about the Commits mailing list