diff --git a/lib/OpenLayers/Tile/UTFGrid.js b/lib/OpenLayers/Tile/UTFGrid.js index 6572e08293..ab057e276f 100644 --- a/lib/OpenLayers/Tile/UTFGrid.js +++ b/lib/OpenLayers/Tile/UTFGrid.js @@ -82,14 +82,12 @@ OpenLayers.Tile.UTFGrid = OpenLayers.Class(OpenLayers.Tile, { this.url = this.layer.getURL(this.bounds); if (this.layer.useJSONP) { - // Use JSONP method to avoid xbrowser polucy - var that = this; - var cback = function(resp) { - that.json = resp.data; - }; + // Use JSONP method to avoid xbrowser policy var ols = new OpenLayers.Protocol.Script({ url: this.url, - callback: cback, + callback: function(response) { + this.json = response.data; + }, scope: this }); ols.read();