[Commits] r1815 - in sandbox/cmoullet/ux/LayerAction: examples ux/widgets

commits at geoext.org commits at geoext.org
Tue Jan 26 10:58:28 CET 2010


Author: cmoullet
Date: 2010-01-26 10:58:28 +0100 (Tue, 26 Jan 2010)
New Revision: 1815

Added:
   sandbox/cmoullet/ux/LayerAction/ux/widgets/GeoRSSLayerAction.js
   sandbox/cmoullet/ux/LayerAction/ux/widgets/GeoRSSLayerWindow.js
Modified:
   sandbox/cmoullet/ux/LayerAction/examples/LayerActionExample.html
   sandbox/cmoullet/ux/LayerAction/examples/LayerActionExample.js
   sandbox/cmoullet/ux/LayerAction/ux/widgets/KMLLayerWindow.js
Log:
Add GeoRSS support


Modified: sandbox/cmoullet/ux/LayerAction/examples/LayerActionExample.html
===================================================================
--- sandbox/cmoullet/ux/LayerAction/examples/LayerActionExample.html	2010-01-26 09:48:51 UTC (rev 1814)
+++ sandbox/cmoullet/ux/LayerAction/examples/LayerActionExample.html	2010-01-26 09:58:28 UTC (rev 1815)
@@ -9,6 +9,8 @@
         <script type="text/javascript" src="../../../trunk/geoext/lib/GeoExt.js"></script>
         <script type="text/javascript" src="../ux/widgets/KMLLayerAction.js"></script>
         <script type="text/javascript" src="../ux/widgets/KMLLayerWindow.js"></script>
+        <script type="text/javascript" src="../ux/widgets/GeoRSSLayerAction.js"></script>
+        <script type="text/javascript" src="../ux/widgets/GeoRSSLayerWindow.js"></script>
         <script type="text/javascript" src="LayerActionExample.js"></script>
 
     </head>

Modified: sandbox/cmoullet/ux/LayerAction/examples/LayerActionExample.js
===================================================================
--- sandbox/cmoullet/ux/LayerAction/examples/LayerActionExample.js	2010-01-26 09:48:51 UTC (rev 1814)
+++ sandbox/cmoullet/ux/LayerAction/examples/LayerActionExample.js	2010-01-26 09:58:28 UTC (rev 1815)
@@ -23,12 +23,16 @@
         map: map
     });
 
+    var addGeoRSSAction = new GeoExt.ux.GeoRSSLayerAction({
+        map: map
+    });
+
     mapPanel = new GeoExt.MapPanel({
-        title: "GeoExt MapPanel add layer capabilities",
+        title: "GeoExt MapPanel with add layer capabilities",
         renderTo: "mappanel",
         height: 400,
         width: 600,
         map: map,
-        tbar: [addKMLAction]
+        tbar: [addKMLAction, addGeoRSSAction]
     });
 });

Added: sandbox/cmoullet/ux/LayerAction/ux/widgets/GeoRSSLayerAction.js
===================================================================
--- sandbox/cmoullet/ux/LayerAction/ux/widgets/GeoRSSLayerAction.js	                        (rev 0)
+++ sandbox/cmoullet/ux/LayerAction/ux/widgets/GeoRSSLayerAction.js	2010-01-26 09:58:28 UTC (rev 1815)
@@ -0,0 +1,51 @@
+/**
+ * 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: (define)
+ *  module = GeoExt.ux
+ *  class = GeoRSSLayerAction
+ *  base_link = `Ext.Action <http://extjs.com/deploy/dev/docs/?class=Ext.Action>`_
+ */
+Ext.namespace("GeoExt.ux");
+
+GeoExt.ux.GeoRSSLayerAction = Ext.extend(Ext.Action, {
+
+    /** api: config[map]
+     *  ``OpenLayers.Map`` The OpenLayers map that the control should be added
+     *  to.  For controls that don't need to be added to a map or have already
+     *  been added to one, this config property may be omitted.
+     */
+    map: null,
+
+    text: 'Add GeoRSS Layer',
+
+    proxyHost: '/cgi-bin/proxy.cgi/?url=',
+
+    constructor: function(config) {
+        if (config.text == undefined) {
+            config.text = this.text;
+        }
+        if (config.handler == undefined) {
+            config.handler = this.handler;
+        }
+        if (config.proxyHost == undefined) {
+            OpenLayers.ProxyHost = this.proxyHost;
+        } else {
+            OpenLayers.ProxyHost = config.proxyHost;
+        }
+
+        arguments.callee.superclass.constructor.call(this, config);
+    },
+
+    handler: function(cmp) {
+        var window = new GeoExt.ux.GeoRSSLayerWindow({
+            map: this.map
+        });
+        window.show();
+    }
+});

Added: sandbox/cmoullet/ux/LayerAction/ux/widgets/GeoRSSLayerWindow.js
===================================================================
--- sandbox/cmoullet/ux/LayerAction/ux/widgets/GeoRSSLayerWindow.js	                        (rev 0)
+++ sandbox/cmoullet/ux/LayerAction/ux/widgets/GeoRSSLayerWindow.js	2010-01-26 09:58:28 UTC (rev 1815)
@@ -0,0 +1,88 @@
+/**
+ * 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.
+ */
+
+Ext.namespace('GeoExt.ux');
+
+/** api: (define)
+ *  module = GeoExt.ux
+ *  class = GeoRSSLayerWindow
+ *  base_link = `Ext.Panel <http://extjs.com/deploy/dev/docs/?class=Ext.Window>`_
+ */
+
+GeoExt.ux.GeoRSSLayerWindow = Ext.extend(Ext.Window, {
+    /** private: property[id]
+     *  ``String``  id set to layermanagerexportwindow (don't change it)
+     */
+    id: 'georsslayerwindow',
+
+    /** private: property[modal]
+     *  ``Boolean``  Define the window as modal.
+     */
+    modal: true,
+
+    /** private: property[title]
+     *  ``String``  Define the title of the window: OpenLayers.i18n('Add KML')
+     */
+    title: OpenLayers.i18n('Add GeoRSS'),
+
+    /** private: property[width]
+     *  ``Number``  Width of the window: 500
+     */
+    width: 500,
+
+    /** private: property[layout]
+     *  ``String``  Layout set to fit
+     */
+    layout:'fit',
+
+    /** private: property[plain]
+     *  ``Boolean``  Plain set to true
+     */
+    plain:true,
+
+    /** private: property[bodyStyle]
+     *  ``String``  Body style set to 'padding:5px;'
+     */
+    bodyStyle:'padding:5px;',
+
+    /** private: property[georssUrl]
+     *  ``String``  GeoRSS Url
+     */
+    georssUrl: 'http://www.gdacs.org/xml/RSSEQLite.xml',
+
+    /** private: method[initComponent]
+     *  Private initComponent override.
+     */
+    initComponent: function() {
+        this.items = [
+            {
+                xtype: 'textfield',
+                id: 'georssUrl',
+                name: 'georssUrl',
+                value: this.georssUrl
+            }
+        ];
+        this.buttons = [
+            {
+                text: OpenLayers.i18n('Load'),
+                handler: function() {
+                    var value = Ext.getCmp('georssUrl').value;
+                    var parts = value.split("/");
+                    var newl = new OpenLayers.Layer.GeoRSS( parts[parts.length-1], value);
+                    this.map.addLayer(newl);
+                    this.close();
+                },
+                scope:this
+            }
+        ];
+        GeoExt.ux.GeoRSSLayerWindow.superclass.initComponent.call(this);
+    }
+});
+
+/** api: xtype = gxux_layermanagerexportwindow */
+Ext.reg('gxux_georsslayerwindow', GeoExt.ux.GeoRSSLayerWindow);
\ No newline at end of file

Modified: sandbox/cmoullet/ux/LayerAction/ux/widgets/KMLLayerWindow.js
===================================================================
--- sandbox/cmoullet/ux/LayerAction/ux/widgets/KMLLayerWindow.js	2010-01-26 09:48:51 UTC (rev 1814)
+++ sandbox/cmoullet/ux/LayerAction/ux/widgets/KMLLayerWindow.js	2010-01-26 09:58:28 UTC (rev 1815)
@@ -71,7 +71,7 @@
             {
                 text: OpenLayers.i18n('Load'),
                 handler: function() {
-                    var value = this.kmlUrl;
+                    var value = Ext.getCmp('kmlUrl').value;
                     var parts = value.split("/");
                     var kmlLayer = new OpenLayers.Layer.GML("KML", this.kmlUrl,
                     {



More information about the Commits mailing list