[Commits] r1816 - in sandbox/cmoullet/ux/LayerAction: examples resources resources/images ux/widgets

commits at geoext.org commits at geoext.org
Tue Jan 26 12:01:21 CET 2010


Author: cmoullet
Date: 2010-01-26 12:01:21 +0100 (Tue, 26 Jan 2010)
New Revision: 1816

Added:
   sandbox/cmoullet/ux/LayerAction/resources/images/
   sandbox/cmoullet/ux/LayerAction/resources/images/EQ.gif
Modified:
   sandbox/cmoullet/ux/LayerAction/examples/LayerActionExample.js
   sandbox/cmoullet/ux/LayerAction/ux/widgets/GeoRSSLayerAction.js
   sandbox/cmoullet/ux/LayerAction/ux/widgets/GeoRSSLayerWindow.js
   sandbox/cmoullet/ux/LayerAction/ux/widgets/KMLLayerWindow.js
Log:
Add style support


Modified: sandbox/cmoullet/ux/LayerAction/examples/LayerActionExample.js
===================================================================
--- sandbox/cmoullet/ux/LayerAction/examples/LayerActionExample.js	2010-01-26 09:58:28 UTC (rev 1815)
+++ sandbox/cmoullet/ux/LayerAction/examples/LayerActionExample.js	2010-01-26 11:01:21 UTC (rev 1816)
@@ -24,7 +24,13 @@
     });
 
     var addGeoRSSAction = new GeoExt.ux.GeoRSSLayerAction({
-        map: map
+        map: map,
+        rssstyle: {
+            externalGraphic: "../resources/images/EQ.gif",
+            graphicWidth: 16,
+            graphicHeight: 16,
+            graphicOpacity: 0.7
+        }
     });
 
     mapPanel = new GeoExt.MapPanel({

Added: sandbox/cmoullet/ux/LayerAction/resources/images/EQ.gif
===================================================================
(Binary files differ)


Property changes on: sandbox/cmoullet/ux/LayerAction/resources/images/EQ.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Modified: sandbox/cmoullet/ux/LayerAction/ux/widgets/GeoRSSLayerAction.js
===================================================================
--- sandbox/cmoullet/ux/LayerAction/ux/widgets/GeoRSSLayerAction.js	2010-01-26 09:58:28 UTC (rev 1815)
+++ sandbox/cmoullet/ux/LayerAction/ux/widgets/GeoRSSLayerAction.js	2010-01-26 11:01:21 UTC (rev 1816)
@@ -17,8 +17,6 @@
 
     /** 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,
 
@@ -26,6 +24,8 @@
 
     proxyHost: '/cgi-bin/proxy.cgi/?url=',
 
+    rssstyle: null,
+
     constructor: function(config) {
         if (config.text == undefined) {
             config.text = this.text;
@@ -44,7 +44,8 @@
 
     handler: function(cmp) {
         var window = new GeoExt.ux.GeoRSSLayerWindow({
-            map: this.map
+            map: this.map,
+            rssstyle: this.rssstyle
         });
         window.show();
     }

Modified: sandbox/cmoullet/ux/LayerAction/ux/widgets/GeoRSSLayerWindow.js
===================================================================
--- sandbox/cmoullet/ux/LayerAction/ux/widgets/GeoRSSLayerWindow.js	2010-01-26 09:58:28 UTC (rev 1815)
+++ sandbox/cmoullet/ux/LayerAction/ux/widgets/GeoRSSLayerWindow.js	2010-01-26 11:01:21 UTC (rev 1816)
@@ -55,6 +55,8 @@
      */
     georssUrl: 'http://www.gdacs.org/xml/RSSEQLite.xml',
 
+    rssstyle: null,
+
     /** private: method[initComponent]
      *  Private initComponent override.
      */
@@ -71,10 +73,19 @@
             {
                 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);
+                    var url = Ext.getCmp('georssUrl').value;
+                    var geoRSSLayer = new OpenLayers.Layer.Vector(OpenLayers.i18n("GeoRSS Layer"), {
+                        strategies: [new OpenLayers.Strategy.Fixed()],
+                        protocol: new OpenLayers.Protocol.HTTP({
+                            url: url,
+                            format: new OpenLayers.Format.GeoRSS({
+                                externalProjection: new OpenLayers.Projection('EPSG:4326'),
+                                internalProjection: new OpenLayers.Projection(this.map.projection)
+                            })
+                        }),
+                        style: this.rssstyle
+                    });
+                    this.map.addLayer(geoRSSLayer);
                     this.close();
                 },
                 scope:this

Modified: sandbox/cmoullet/ux/LayerAction/ux/widgets/KMLLayerWindow.js
===================================================================
--- sandbox/cmoullet/ux/LayerAction/ux/widgets/KMLLayerWindow.js	2010-01-26 09:58:28 UTC (rev 1815)
+++ sandbox/cmoullet/ux/LayerAction/ux/widgets/KMLLayerWindow.js	2010-01-26 11:01:21 UTC (rev 1816)
@@ -71,16 +71,17 @@
             {
                 text: OpenLayers.i18n('Load'),
                 handler: function() {
-                    var value = Ext.getCmp('kmlUrl').value;
-                    var parts = value.split("/");
-                    var kmlLayer = new OpenLayers.Layer.GML("KML", this.kmlUrl,
-                    {
-                        format: OpenLayers.Format.KML,
-                        formatOptions: {
-                            extractStyles: true,
-                            extractAttributes: true,
-                            maxDepth: 2
-                        }
+                    var kmlUrl = Ext.getCmp('kmlUrl').value;
+                    var kmlLayer = new OpenLayers.Layer.Vector(OpenLayers.i18n("KML Layer"), {
+                        strategies: [new OpenLayers.Strategy.Fixed()],
+                        protocol: new OpenLayers.Protocol.HTTP({
+                            url: kmlUrl,
+                            format: new OpenLayers.Format.KML({
+                                externalProjection: new OpenLayers.Projection('EPSG:4326'),
+                                internalProjection: new OpenLayers.Projection(this.map.projection),
+                                extractStyles: true
+                            })
+                        })
                     });
                     this.map.addLayer(kmlLayer);
                     this.close();



More information about the Commits mailing list