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.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);
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user