Changeset 487
- Timestamp:
- 05/31/06 21:15:23 (2 years ago)
- Files:
-
- trunk/openlayers/lib/OpenLayers/Ajax.js (modified) (3 diffs)
- trunk/openlayers/lib/OpenLayers/Tile/WFS.js (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/openlayers/lib/OpenLayers/Ajax.js
r324 r487 6 6 * Ajax reader for OpenLayers 7 7 * 8 * Pay close attention to how this works:9 *10 8 *@uri url to do remote XML http get 11 9 *@param 'get' format params (x=y&a=b...) 12 *@who object which is providing a specificcallbacks for this request13 *@complete the name of the function which must be defined in the callers.handler[] array14 *@failure the name of the function which must be defined in the callers.handler[] array10 *@who object to handle callbacks for this request 11 *@complete the function to be called on success 12 *@failure the function to be called on failure 15 13 * 16 14 * example usage from a caller: 17 15 * 18 * this.handlers["caps"] = function(request){..} 19 * OpenLayers.loadURL(url,params,this,"caps"); 16 * caps: function(request) { 17 * -blah- 18 * }, 19 * 20 * OpenLayers.loadURL(url,params,this,caps); 20 21 * 21 22 * Notice the above example does not provide an error handler; a default empty 22 * handler is provided which merely logs the error if a failure handler is not supplied 23 * handler is provided which merely logs the error if a failure handler is not 24 * supplied 23 25 * 24 26 */ … … 56 58 // ol.Log.debug("loadURL [" + uri + "]"); 57 59 58 var successx; 59 var failurex; 60 var bind1 = null; 61 var bind2 = null; 60 var success = (onComplete) ? onComplete.bind(caller) 61 : OpenLayers.nullHandler; 62 62 63 if (onComplete) { 64 successx = caller.handlers[onComplete]; 65 bind1 = caller; 66 } else { 67 successx = OpenLayers.nullHandler; 68 } 69 70 if (onFailure) { 71 failurex = caller.handlers[onFailure]; 72 bind2=caller; 73 } else { 74 failurex = OpenLayers.nullHandler; 75 } 63 var failure = (onFailure) ? onFailure.bind(caller) 64 : OpenLayers.nullHandler; 76 65 77 66 // from prototype.js … … 79 68 { method: 'get', 80 69 parameters: params, 81 onComplete: success x.bind(bind1),82 onFailure: failure x.bind(bind2)70 onComplete: success, 71 onFailure: failure 83 72 } 84 73 ); trunk/openlayers/lib/OpenLayers/Tile/WFS.js
r407 r487 27 27 28 28 this.features = new Array(); 29 30 this.handlers = new Array();31 this.handlers["requestSuccess"] = this.requestSuccess;32 29 }, 33 30 … … 36 33 draw:function() { 37 34 OpenLayers.Tile.prototype.draw.apply(this, arguments); 38 this.loadFeaturesForRegion( "requestSuccess");35 this.loadFeaturesForRegion(this.requestSuccess); 39 36 }, 40 37
