The parseData method doesn't need to know of XHR.

This commit is contained in:
Tim Schaub
2012-02-25 20:51:03 -07:00
parent 12fa9b54ef
commit 8c95a90052
+6 -3
View File
@@ -110,7 +110,7 @@ OpenLayers.Tile.UTFGrid = OpenLayers.Class(OpenLayers.Tile, {
this.isLoading = false; this.isLoading = false;
this.events.triggerEvent("loadend"); this.events.triggerEvent("loadend");
if (response.status === 200) { if (response.status === 200) {
this.parseData(response); this.parseData(response.responseText);
} }
}, },
scope: this scope: this
@@ -125,15 +125,18 @@ OpenLayers.Tile.UTFGrid = OpenLayers.Class(OpenLayers.Tile, {
/** /**
* Method: parseJSON * Method: parseJSON
* Parse the JSON from a request * Parse the JSON from a request
*
* Parameters:
* str - {String} UTFGrid as a JSON string.
* *
* Returns: * Returns:
* {Object} parsed javascript data * {Object} parsed javascript data
*/ */
parseData: function(req) { parseData: function(str) {
if (!this.format) { if (!this.format) {
this.format = new OpenLayers.Format.JSON(); this.format = new OpenLayers.Format.JSON();
} }
this.json = this.format.read(req.responseText); this.json = this.format.read(str);
}, },
/** /**