[Commits] r191 - sandbox/opengeo/drake/trunk/apps/drake

commits at geoext.org commits at geoext.org
Wed Feb 18 18:38:10 CET 2009


Author: tcoulter
Date: 2009-02-18 18:38:10 +0100 (Wed, 18 Feb 2009)
New Revision: 191

Modified:
   sandbox/opengeo/drake/trunk/apps/drake/index.html
Log:
Made proxy use less confusing by making the store only have one type of proxy, ever. This reduces our interfaces that we use (we now only use this.store.proxy rather than this.store.proxy and this.proxy). I also made the initProxy method only a creator, not a creator and an initializer, and hanged the name to reflect this.

Modified: sandbox/opengeo/drake/trunk/apps/drake/index.html
===================================================================
--- sandbox/opengeo/drake/trunk/apps/drake/index.html	2009-02-18 16:33:50 UTC (rev 190)
+++ sandbox/opengeo/drake/trunk/apps/drake/index.html	2009-02-18 17:38:10 UTC (rev 191)
@@ -123,7 +123,6 @@
                     }
     
                     this.initFilter();
-                    this.initProxy();
                     this.initStore();
                     this.initWMSStore();
                     this.initMap();
@@ -166,7 +165,7 @@
             });
         },
         
-        initProxy: function(params) {
+        createProxy: function(params) {
             params = params || {};
             var type = params.type || this.featureType;
             var ns = params.namespace || 'http://www.openplans.org/topp';
@@ -181,19 +180,16 @@
                 version: "1.1.0"
             });
         
-            this.proxy = new GeoExt.data.ProtocolProxy({protocol: proto});
-            return this.proxy;
+            return new GeoExt.data.ProtocolProxy({protocol: proto});
         },
         
         initStore: function() {
             // create the data store
             this.store = new Ext.data.Store({
-                proxy: new Ext.data.MemoryProxy([]), 
+                proxy: this.createProxy(),
                 remoteSort: true,
                 reader: new Ext.data.JsonReader({}, [])
             });
-    
-            // this.store.load({params: {start: 0, limit: 7}});
         },
         
         initWMSStore: function() {
@@ -221,16 +217,16 @@
                     enableToggle: true, 
                     handler: function(checkbox, checked) {
                         if (checked){
-                            this.proxy.setOGCFilter(this.filterBuilder.getFilter());
+                            this.store.proxy.setOGCFilter(this.filterBuilder.getFilter());
                             this.filterBuilder.on("change", this.updateQueryFilter, this);
                         } else {
-                            this.proxy.setOGCFilter(null);
+                            this.store.proxy.setOGCFilter(null);
                             this.filterBuilder.un("change", this.updateQueryFilter, this);
                         }
                         this.grid.store.load({
                             params: {
                                 start: 0,
-                                limit: 7
+                                limit: this.featuresPerPage
                             }
                         }); 
                     },
@@ -585,19 +581,18 @@
             this.featurePrefix = parts[0];
             this.featureType   = parts[1];
 
-            this.initProxy({prefix: parts[0], type: parts[1], namespace: namespace});
-            this.store.proxy = this.proxy;
+            this.store.proxy = this.createProxy({prefix: parts[0], type: parts[1], namespace: namespace});
             this.store.reader = new GeoExt.data.FeatureReader({}, recordize(this.fields));
  
             this.grid.setTitle(typename + " - " + namespace);
             this.grid.colModel.setConfig(columnize(this.fields));
 
-            this.store.load({params: {start: 0, limit: 7}});
+            this.store.load({params: {start: 0, limit: this.featuresPerPage}});
         },
 
         updateQueryFilter: function(builder){
-            this.proxy.setOGCFilter(builder.getFilter());
-            this.store.load({params: {start: 0, limit: 7}});
+            this.store.proxy.setOGCFilter(builder.getFilter());
+            this.store.load({params: {start: 0, limit: this.featuresPerPage}});
         }
     };
 
@@ -608,7 +603,10 @@
             
             geoserverUrl: "/geoserver",
             wmsUrl: "/geoserver/wms",
-            wfsUrl: "/geoserver/wfs"
+            wfsUrl: "/geoserver/wfs",
+            
+            maxFeatures: 300,
+            featuresPerPage: 7
         });
     });
 



More information about the Commits mailing list