The parseData method doesn't need to know of XHR.
This commit is contained in:
@@ -110,7 +110,7 @@ OpenLayers.Tile.UTFGrid = OpenLayers.Class(OpenLayers.Tile, {
|
||||
this.isLoading = false;
|
||||
this.events.triggerEvent("loadend");
|
||||
if (response.status === 200) {
|
||||
this.parseData(response);
|
||||
this.parseData(response.responseText);
|
||||
}
|
||||
},
|
||||
scope: this
|
||||
@@ -125,15 +125,18 @@ OpenLayers.Tile.UTFGrid = OpenLayers.Class(OpenLayers.Tile, {
|
||||
/**
|
||||
* Method: parseJSON
|
||||
* Parse the JSON from a request
|
||||
*
|
||||
* Parameters:
|
||||
* str - {String} UTFGrid as a JSON string.
|
||||
*
|
||||
* Returns:
|
||||
* {Object} parsed javascript data
|
||||
*/
|
||||
parseData: function(req) {
|
||||
parseData: function(str) {
|
||||
if (!this.format) {
|
||||
this.format = new OpenLayers.Format.JSON();
|
||||
}
|
||||
this.json = this.format.read(req.responseText);
|
||||
this.json = this.format.read(str);
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user