Pass the callback scope to getURLasync
This commit is contained in:
@@ -206,8 +206,9 @@ OpenLayers.Layer.ArcIMS = OpenLayers.Class(OpenLayers.Layer.Grid, {
|
||||
* bounds - {<OpenLayers.Bounds>} A bounds representing the bbox for the
|
||||
* request.
|
||||
* callback - {Function} Function to call when image url is retrieved.
|
||||
* scope - {Object} The scope of the callback method.
|
||||
*/
|
||||
getURLasync: function(bounds, callback) {
|
||||
getURLasync: function(bounds, callback, scope) {
|
||||
bounds = this.adjustBounds(bounds);
|
||||
|
||||
// create an arcxml request to generate the image
|
||||
@@ -236,7 +237,7 @@ OpenLayers.Layer.ArcIMS = OpenLayers.Class(OpenLayers.Layer.Grid, {
|
||||
var axlResp = new OpenLayers.Format.ArcXML();
|
||||
var arcxml = axlResp.read(doc);
|
||||
|
||||
callback(this.getUrlOrImage(arcxml.image.output));
|
||||
callback.call(scope, this.getUrlOrImage(arcxml.image.output));
|
||||
},
|
||||
scope: this
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user