Change getUrlAsync parameters.
Instead of giving the function a bound, a scope, a property to update and a callback, only give the bound and a callback. When the url is retrieved by getUrlAsync, simply call the callback with the url as argument and let the caller manage this.
This commit is contained in:
@@ -205,12 +205,9 @@ OpenLayers.Layer.ArcIMS = OpenLayers.Class(OpenLayers.Layer.Grid, {
|
||||
* Parameters:
|
||||
* bounds - {<OpenLayers.Bounds>} A bounds representing the bbox for the
|
||||
* request.
|
||||
* scope - {Object} The scope of the callback method.
|
||||
* prop - {String} The name of the property in the scoped object to
|
||||
* recieve the image url.
|
||||
* callback - {Function} Function to call when image url is retrieved.
|
||||
*/
|
||||
getURLasync: function(bounds, scope, prop, callback) {
|
||||
getURLasync: function(bounds, callback) {
|
||||
bounds = this.adjustBounds(bounds);
|
||||
|
||||
// create an arcxml request to generate the image
|
||||
@@ -239,11 +236,7 @@ OpenLayers.Layer.ArcIMS = OpenLayers.Class(OpenLayers.Layer.Grid, {
|
||||
var axlResp = new OpenLayers.Format.ArcXML();
|
||||
var arcxml = axlResp.read(doc);
|
||||
|
||||
scope[prop] = this.getUrlOrImage(arcxml.image.output);
|
||||
|
||||
// call the callback function to recieve the updated property on the
|
||||
// scoped object
|
||||
callback.apply(scope);
|
||||
callback(this.getUrlOrImage(arcxml.image.output));
|
||||
},
|
||||
scope: this
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user