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:
@@ -82,14 +82,12 @@ OpenLayers.Tile.UTFGrid = OpenLayers.Class(OpenLayers.Tile, {
|
|||||||
this.url = this.layer.getURL(this.bounds);
|
this.url = this.layer.getURL(this.bounds);
|
||||||
|
|
||||||
if (this.layer.useJSONP) {
|
if (this.layer.useJSONP) {
|
||||||
// Use JSONP method to avoid xbrowser polucy
|
// Use JSONP method to avoid xbrowser policy
|
||||||
var that = this;
|
|
||||||
var cback = function(resp) {
|
|
||||||
that.json = resp.data;
|
|
||||||
};
|
|
||||||
var ols = new OpenLayers.Protocol.Script({
|
var ols = new OpenLayers.Protocol.Script({
|
||||||
url: this.url,
|
url: this.url,
|
||||||
callback: cback,
|
callback: function(response) {
|
||||||
|
this.json = response.data;
|
||||||
|
},
|
||||||
scope: this
|
scope: this
|
||||||
});
|
});
|
||||||
ols.read();
|
ols.read();
|
||||||
|
|||||||
Reference in New Issue
Block a user