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.
This commit is contained in:
Tim Schaub
2012-02-25 20:09:34 -07:00
parent 73e6973ab5
commit e6f0aa08e5

View File

@@ -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();