[Commits] r170 - sandbox/opengeo/drake/trunk/core/lib/GeoExt/data

commits at geoext.org commits at geoext.org
Sat Feb 14 00:50:56 CET 2009


Author: sbenthall
Date: 2009-02-14 00:50:56 +0100 (Sat, 14 Feb 2009)
New Revision: 170

Modified:
   sandbox/opengeo/drake/trunk/core/lib/GeoExt/data/FeatureStore.js
Log:
fixes and hacks to FeatureStore


Modified: sandbox/opengeo/drake/trunk/core/lib/GeoExt/data/FeatureStore.js
===================================================================
--- sandbox/opengeo/drake/trunk/core/lib/GeoExt/data/FeatureStore.js	2009-02-13 23:50:02 UTC (rev 169)
+++ sandbox/opengeo/drake/trunk/core/lib/GeoExt/data/FeatureStore.js	2009-02-13 23:50:56 UTC (rev 170)
@@ -4,10 +4,6 @@
     GeoExt.data.FeatureStore.superclass.constructor.call(
         this,
         Ext.apply(c, {
-            proxy: c.proxy || (!c.data ?
-                new Ext.data.HttpProxy({url: c.url, disableCaching: false, method: "GET"}) :
-                undefined
-            ),
             reader: new GeoExt.data.FeatureReader(
                 c, c.fields || []
             )
@@ -30,15 +26,15 @@
 
         //should probably be in constructor
         this.featureStoreMediator = new GeoExt.data.FeatureStoreMediator({
-            store: this
+            store: this,
+            append: false,
         });
 
         this.bindLayer(layer);
 
-        
+        return layer;
+    },
 
-    }
-
     /**
      * API Method: bindStore
      * In the parlance of Ext, this function takes a store, removes listeners
@@ -53,10 +49,10 @@
              this.un("remove", this.layerHandlers.onRemove, layer);
          }
 
-         this.store.on("load", this.layerHandlers.onLoad, layer);
-         this.store.on("loadexception", this.layerHandlers.onLoadException, layer);
-         this.store.on("add", this.layerHandlers.onAdd, layer);
-         this.store.on("remove", this.layerHandlers.onRemove, layer);
+         this.on("load", this.layerHandlers.onLoad, layer);
+         this.on("loadexception", this.layerHandlers.onLoadException, layer);
+         this.on("add", this.layerHandlers.onAdd, layer);
+         this.on("remove", this.layerHandlers.onRemove, layer);
 
          var updateStore = function(){
              this.update(layer);
@@ -76,7 +72,7 @@
         onLoad: function(store, options) {
             this.removeFeatures(this.features);
             store.each(function(record) {
-                this.addFeatures(this.getFeatureFromRecord(record));
+                this.addFeatures(record.data.feature, {silent: true});
             }, this)
         },
     
@@ -86,17 +82,13 @@
     
         onAdd: function(store, records, index) {
             for (var index = 0; index < records.length; index++) {
-                this.addFeatures(this.getFeatureFromRecord(records[index]));
+                this.addFeatures(records[index].data.feature, {silent: true});
             }  
         },
     
         onRemove: function(store, record, index) {
-            this.removeFeatures(this.getFeatureFromRecord(record));
+            this.removeFeatures(record.data.feature,  {silent: true});
         },
-    
-        getFeatureFromRecord: function(record) {
-            return record.data.feature;
-        }
     },
 
     /**
@@ -108,8 +100,6 @@
      *      evaluates to true the feature is added to the store.
      */
     update: function(layer) {
-        this.featureStoreMediator.addFeatures(
-            layer.features,
-            {append: false, filter: this.filter});
+        this.featureStoreMediator.addFeatures(layer.features);
     }
 });



More information about the Commits mailing list