Ticket #57: 57.patch
| File 57.patch, 2.8 kB (added by sbenthall, 1 year ago) |
|---|
-
tests/lib/GeoExt/data/LayerStore.html
old new 76 76 77 77 function test_add_remove(t) { 78 78 79 t.plan( 2);79 t.plan(3); 80 80 81 81 var map = new OpenLayers.Map("mappanel"); 82 82 var store = new GeoExt.data.LayerStore({ … … 91 91 92 92 store.remove(record); 93 93 t.eq(store.getCount(), 0, "removing a single record from the store removes one record"); 94 95 //test adding a record with the same id 96 store.add([record]); 97 store.add(store.getAt(0).copy()); 98 t.eq(map.layers.length,store.getCount(),"number of OpenLayers map layers equals number of records after adding record with same id"); 94 99 100 101 95 102 } 96 103 97 104 function test_reorder(t) { -
lib/GeoExt/data/LayerStore.js
old new 110 110 "remove": this.onRemove, 111 111 scope: this 112 112 }); 113 this.data.on({ 114 "replace" : this.onReplace, 115 scope: this 116 }); 113 117 } 114 118 }, 115 119 … … 130 134 "remove": this.onRemove, 131 135 scope: this 132 136 }); 137 this.data.un({ 138 "replace" : this.onReplace, 139 scope: this 140 }); 133 141 this.map = null; 134 142 } 135 143 }, … … 236 244 this.map.removeLayer(record.get("layer")); 237 245 delete this._removing; 238 246 } 247 }, 248 249 /** 250 * Method: onReplace 251 * Handler for a store's data collections' replace event 252 * 253 * Parameters: 254 * key - {String} 255 * oldRecord - {Object} In this case, a record that has been replaced. 256 * newRecord - {Object} In this case, a record that is replacing oldRecord. 257 */ 258 onReplace: function(key, oldRecord, newRecord){ 259 this.remove(oldRecord); 239 260 } 240 261 }; 241 262 -
modifications.txt
old new 15 15 * Let components do special processing before being added to or removed from a MapPanel (#45) 16 16 * Add ScaleSlider and tips (#16) 17 17 * gxtheme css for geoext styles compatible with ext's xtheme (#51) 18 * Keeping LayerStore and bound Map in sync when a record is replaced by add() method (and regression test) (#57)