Changeset 7412
- Timestamp:
- 06/21/08 01:05:30 (5 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
sandbox/topp/almanac/lib/OpenLayers/Layer/Vector.js
r7400 r7412 78 78 * Listeners will receive an object with a *feature* property referencing 79 79 * the modified feature. 80 * - *refresh* Triggered when something wants a strategy to ask the protocol 81 * for a new set of features. 80 82 */ 81 83 EVENT_TYPES: ["beforefeatureadded", "beforefeaturesadded", … … 83 85 "beforefeatureremoved", "featureremoved", "featuresremoved", 84 86 "featureserased", "featureselected", "featureunselected", 85 "beforefeaturemodified", "featuremodified", "afterfeaturemodified"], 87 "beforefeaturemodified", "featuremodified", "afterfeaturemodified", 88 "refresh"], 86 89 87 90 /** … … 251 254 } 252 255 OpenLayers.Layer.prototype.destroy.apply(this, arguments); 256 }, 257 258 /** 259 * Method: refresh 260 * Ask the layer to request features again and redraw them. 261 * 262 * Parameters: 263 * event - {Object} Optional object with properties for any listener of 264 * the refresh event. 265 */ 266 refresh: function(event) { 267 this.events.triggerEvent("refresh", event); 253 268 }, 254 269 sandbox/topp/almanac/lib/OpenLayers/Strategy/BBOX.js
r7405 r7412 46 46 activate: function() { 47 47 this.layer.map.events.on({ 48 "moveend": this.moveendListener, 49 "readrequested": this.triggerRead, 48 "moveend": this.updateListener, 49 scope: this 50 }); 51 this.layer.events.on({ 52 "refresh": this.updateListener, 50 53 scope: this 51 54 }); … … 57 60 */ 58 61 deactivate: function() { 59 this.layer.map.events.off({ 60 "moveend": this.moveendListener, 61 "readrequested": this.triggerRead, 62 this.layer.map.events.un({ 63 "moveend": this.updateListener, 64 scope: this 65 }); 66 this.layer.events.un({ 67 "refresh": this.updateListener, 62 68 scope: this 63 69 }); … … 65 71 66 72 /** 67 * Method: moveendListener73 * Method: updateListener 68 74 */ 69 moveendListener: function(evt) {75 updateListener: function(event) { 70 76 var mapBounds = this.layer.map.getExtent(); 71 if( this.invalidBounds(mapBounds)) {77 if(event.force || this.invalidBounds(mapBounds)) { 72 78 this.calculateBounds(mapBounds); 73 79 this.triggerRead();
