From e6f0aa08e577a10bb378af536ad2a387d6883adf Mon Sep 17 00:00:00 2001 From: Tim Schaub Date: Sat, 25 Feb 2012 20:09:34 -0700 Subject: [PATCH] Cleanup use of Script protocol. I would think there would still be an error thrown here. Will put together a test to determine for sure, but I'd think that the default GeoJSON parser used by the protocol would choke on the UTFGrid json. --- lib/OpenLayers/Tile/UTFGrid.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) 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();