[Commits] r1682 - in sandbox/cmoullet/ux: . Toolbar/examples Toolbar/ux/widgets

commits at geoext.org commits at geoext.org
Sat Jan 9 05:22:05 CET 2010


Author: cmoullet
Date: 2010-01-09 05:22:05 +0100 (Sat, 09 Jan 2010)
New Revision: 1682

Added:
   sandbox/cmoullet/ux/Toolbar/
   sandbox/cmoullet/ux/Toolbar/examples/ToolbarExample.html
   sandbox/cmoullet/ux/Toolbar/examples/ToolbarExample.js
Removed:
   sandbox/cmoullet/ux/Toolbar/examples/ToolbarItemsExample.html
   sandbox/cmoullet/ux/Toolbar/examples/ToolbarItemsExample.js
Modified:
   sandbox/cmoullet/ux/Toolbar/ux/widgets/LoadingStatusBar.js
   sandbox/cmoullet/ux/Toolbar/ux/widgets/MousePositionItem.js
Log:
Continue renaming

Copied: sandbox/cmoullet/ux/Toolbar (from rev 1677, sandbox/cmoullet/ux/ToolbarItems)

Added: sandbox/cmoullet/ux/Toolbar/examples/ToolbarExample.html
===================================================================
--- sandbox/cmoullet/ux/Toolbar/examples/ToolbarExample.html	                        (rev 0)
+++ sandbox/cmoullet/ux/Toolbar/examples/ToolbarExample.html	2010-01-09 04:22:05 UTC (rev 1682)
@@ -0,0 +1,24 @@
+<html>
+    <head>
+        <title>Toolbar Example</title>
+
+        <script type="text/javascript" src="http://extjs.cachefly.net/builds/ext-cdn-771.js"></script>
+        <link rel="stylesheet" type="text/css" href="http://extjs.cachefly.net/ext-2.2.1/resources/css/ext-all.css" />
+        <link rel="stylesheet" type="text/css" href="http://extjs.cachefly.net/ext-2.2.1/examples/shared/examples.css" />
+        <script type="text/javascript" src="http://openlayers.org/api/2.8/OpenLayers.js"></script>
+        <script type="text/javascript" src="../../../trunk/geoext/lib/GeoExt.js"></script>
+        <script type="text/javascript" src="../ux/widgets/LoadingStatusBar.js"></script>
+        <script type="text/javascript" src="../ux/widgets/MousePositionItem.js"></script>
+        <script type="text/javascript" src="ToolbarExample.js"></script>
+
+
+    </head>
+    <body>
+        <h1>Toolbar</h1>
+        <p>This example demonstrates the following toolbar components:<p>
+        <p>- mouse position<p>
+        <p>- loading status<p>
+        <p>The js is not minified so it is readable. See <a href="ToolbarExample.js">ToolbarExample.js</a>.</p>
+        <div id="mappanel"></div>
+    </body>
+</html>

Added: sandbox/cmoullet/ux/Toolbar/examples/ToolbarExample.js
===================================================================
--- sandbox/cmoullet/ux/Toolbar/examples/ToolbarExample.js	                        (rev 0)
+++ sandbox/cmoullet/ux/Toolbar/examples/ToolbarExample.js	2010-01-09 04:22:05 UTC (rev 1682)
@@ -0,0 +1,56 @@
+/**
+ * Copyright (c) 2008-2009 The Open Source Geospatial Foundation
+ *
+ * Published under the BSD license.
+ * See http://svn.geoext.org/core/trunk/geoext/license.txt for the full text
+ * of the license.
+ */
+
+/** api: example[ToolbarItems]
+ *  Toolbar items
+ *  ---------------------
+ *  Items to be placed in a toolbare
+ */
+
+var mapPanel;
+
+Ext.onReady(function() {
+    var map = new OpenLayers.Map();
+    var layer = new OpenLayers.Layer.OSM("OSM");
+    map.addLayer(layer);
+
+    var mousePositionItem = new GeoExt.ux.Toolbar.MousePositionItem({
+        map: map,
+        controlOptions: {
+            numDigits: 0
+        }
+    });
+
+    var mousePositionItem2 = new GeoExt.ux.Toolbar.MousePositionItem({
+        map: map,
+        controlOptions: {
+            prefix: 'Coordinates: ',
+            numDigits: 1
+        }
+    });
+
+    var loadingStatusBar = new GeoExt.ux.LoadingStatusBar({
+        map: map,
+        statusAlign: 'right',
+        busyText: 'Map loading: contact your provider to get a fastest connection ;-)',
+        items: [
+            mousePositionItem
+        ]
+    });
+
+
+    mapPanel = new GeoExt.MapPanel({
+        title: "GeoExt MapPanel with Toolbars",
+        renderTo: "mappanel",
+        height: 400,
+        width: 600,
+        map: map,
+        tbar: [mousePositionItem2],
+        bbar: loadingStatusBar
+    });
+});
\ No newline at end of file

Deleted: sandbox/cmoullet/ux/Toolbar/examples/ToolbarItemsExample.html
===================================================================
--- sandbox/cmoullet/ux/ToolbarItems/examples/ToolbarItemsExample.html	2010-01-08 22:14:24 UTC (rev 1677)
+++ sandbox/cmoullet/ux/Toolbar/examples/ToolbarItemsExample.html	2010-01-09 04:22:05 UTC (rev 1682)
@@ -1,24 +0,0 @@
-<html>
-    <head>
-        <title>Toolbar Items Example</title>
-
-        <script type="text/javascript" src="http://extjs.cachefly.net/builds/ext-cdn-771.js"></script>
-        <link rel="stylesheet" type="text/css" href="http://extjs.cachefly.net/ext-2.2.1/resources/css/ext-all.css" />
-        <link rel="stylesheet" type="text/css" href="http://extjs.cachefly.net/ext-2.2.1/examples/shared/examples.css" />
-        <script type="text/javascript" src="http://openlayers.org/api/2.8/OpenLayers.js"></script>
-        <script type="text/javascript" src="../../../trunk/geoext/lib/GeoExt.js"></script>
-        <script type="text/javascript" src="../ux/widgets/LoadingStatusBar.js"></script>
-        <script type="text/javascript" src="../ux/widgets/MousePositionItem.js"></script>
-        <script type="text/javascript" src="ToolbarItemsExample.js"></script>
-
-
-    </head>
-    <body>
-        <h1>Scale selector</h1>
-        <p>This example demonstrates the following toolbar items:<p>
-        <p>- loading status<p>
-        <p>- mouse position<p>
-        <p>The js is not minified so it is readable. See <a href="ToolbarItemsExample.js">ToolbarItemsExample.js</a>.</p>
-        <div id="mappanel"></div>
-    </body>
-</html>

Deleted: sandbox/cmoullet/ux/Toolbar/examples/ToolbarItemsExample.js
===================================================================
--- sandbox/cmoullet/ux/ToolbarItems/examples/ToolbarItemsExample.js	2010-01-08 22:14:24 UTC (rev 1677)
+++ sandbox/cmoullet/ux/Toolbar/examples/ToolbarItemsExample.js	2010-01-09 04:22:05 UTC (rev 1682)
@@ -1,43 +0,0 @@
-/**
- * Copyright (c) 2008-2009 The Open Source Geospatial Foundation
- *
- * Published under the BSD license.
- * See http://svn.geoext.org/core/trunk/geoext/license.txt for the full text
- * of the license.
- */
-
-/** api: example[ToolbarItems]
- *  Toolbar items
- *  ---------------------
- *  Items to be placed in a toolbare
- */
-
-var mapPanel;
-
-Ext.onReady(function() {
-    var map = new OpenLayers.Map();
-    var layer = new OpenLayers.Layer.OSM("OSM");
-    map.addLayer(layer);
-
-    var loadingStatusBar = new GeoExt.ux.LoadingStatusBar({
-        map: map
-    });
-
-    var mousePositionItem = new GeoExt.ux.Toolbar.MousePositionItem({
-        map: map,
-        controlOptions: {
-            prefix: 'Coord: ',
-            numDigits: 0
-        }
-    });
-
-    mapPanel = new GeoExt.MapPanel({
-        title: "GeoExt MapPanel with Scale Selector",
-        renderTo: "mappanel",
-        height: 400,
-        width: 600,
-        map: map,
-        tbar: [mousePositionItem],
-        bbar: loadingStatusBar
-    });
-});
\ No newline at end of file

Modified: sandbox/cmoullet/ux/Toolbar/ux/widgets/LoadingStatusBar.js
===================================================================
--- sandbox/cmoullet/ux/ToolbarItems/ux/widgets/LoadingStatusBar.js	2010-01-08 22:14:24 UTC (rev 1677)
+++ sandbox/cmoullet/ux/Toolbar/ux/widgets/LoadingStatusBar.js	2010-01-09 04:22:05 UTC (rev 1682)
@@ -114,5 +114,5 @@
     }
 });
 
-/** api: xtype = gxux_loadingstatus */
-Ext.reg('gxux_loadingstatus', GeoExt.ux.LoadingStatusBar);
+/** api: xtype = gxux_loadingstatusbar */
+Ext.reg('gxux_loadingstatusbar', GeoExt.ux.LoadingStatusBar);

Modified: sandbox/cmoullet/ux/Toolbar/ux/widgets/MousePositionItem.js
===================================================================
--- sandbox/cmoullet/ux/ToolbarItems/ux/widgets/MousePositionItem.js	2010-01-08 22:14:24 UTC (rev 1677)
+++ sandbox/cmoullet/ux/Toolbar/ux/widgets/MousePositionItem.js	2010-01-09 04:22:05 UTC (rev 1682)
@@ -16,18 +16,35 @@
 
 GeoExt.ux.Toolbar.MousePositionItem = Ext.extend(Ext.Toolbar.TextItem, {
 
+    /** api: config[map]
+     *  ``OpenLayers.Map`` or :class:`GeoExt.MapPanel`
+     */
+    map: null,
+
+    /** api: config[mousePositionControl]
+     *  ``OpenLayers.Control.MousePosition`` Optional mouse position control
+     */
+    mousePositionControl: null,
+
     constructor: function(config) {
+        if (config.map && config.map instanceof GeoExt.MapPanel) {
+            config.map = config.map.map;
+        }
         this.map = config.map || null;
         this.controlOptions = config.controlOptions || {};
         GeoExt.ux.Toolbar.MousePositionItem.superclass.constructor.call(this, this.text || "");
     },
-    
+
     render: function(td) {
         var config = OpenLayers.Util.extend(this.controlOptions, {
             div:this.el
         });
-        this.control = new OpenLayers.Control.MousePosition(config);
-        this.map.addControl(this.control);
+        if (this.map) {
+            if (!this.mousePositionControl) {
+                this.mousePositionControl = new OpenLayers.Control.MousePosition(config);
+            }
+            this.map.addControl(this.mousePositionControl);
+        }
         GeoExt.ux.Toolbar.MousePositionItem.superclass.render.call(this, td);
     }
 });



More information about the Commits mailing list