Remove opt_this param in forDataAtCoordinate function
This commit is contained in:
@@ -138,25 +138,23 @@ export class CustomTile extends Tile {
|
|||||||
* Calls the callback (synchronously by default) with the available data
|
* Calls the callback (synchronously by default) with the available data
|
||||||
* for given coordinate (or `null` if not yet loaded).
|
* for given coordinate (or `null` if not yet loaded).
|
||||||
* @param {import("../coordinate.js").Coordinate} coordinate Coordinate.
|
* @param {import("../coordinate.js").Coordinate} coordinate Coordinate.
|
||||||
* @param {function(this: T, *): void} callback Callback.
|
* @param {function(*): void} callback Callback.
|
||||||
* @param {T=} opt_this The object to use as `this` in the callback.
|
|
||||||
* @param {boolean=} opt_request If `true` the callback is always async.
|
* @param {boolean=} opt_request If `true` the callback is always async.
|
||||||
* The tile data is requested if not yet loaded.
|
* The tile data is requested if not yet loaded.
|
||||||
* @template T
|
|
||||||
*/
|
*/
|
||||||
forDataAtCoordinate(coordinate, callback, opt_this, opt_request) {
|
forDataAtCoordinate(coordinate, callback, opt_request) {
|
||||||
if (this.state == TileState.IDLE && opt_request === true) {
|
if (this.state == TileState.IDLE && opt_request === true) {
|
||||||
listenOnce(this, EventType.CHANGE, function(e) {
|
listenOnce(this, EventType.CHANGE, function(e) {
|
||||||
callback.call(opt_this, this.getData(coordinate));
|
callback(this.getData(coordinate));
|
||||||
}, this);
|
}, this);
|
||||||
this.loadInternal_();
|
this.loadInternal_();
|
||||||
} else {
|
} else {
|
||||||
if (opt_request === true) {
|
if (opt_request === true) {
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
callback.call(opt_this, this.getData(coordinate));
|
callback(this.getData(coordinate));
|
||||||
}.bind(this), 0);
|
}.bind(this), 0);
|
||||||
} else {
|
} else {
|
||||||
callback.call(opt_this, this.getData(coordinate));
|
callback(this.getData(coordinate));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -391,7 +389,7 @@ class UTFGrid extends TileSource {
|
|||||||
coordinate, resolution);
|
coordinate, resolution);
|
||||||
const tile = /** @type {!CustomTile} */(this.getTile(
|
const tile = /** @type {!CustomTile} */(this.getTile(
|
||||||
tileCoord[0], tileCoord[1], tileCoord[2], 1, this.getProjection()));
|
tileCoord[0], tileCoord[1], tileCoord[2], 1, this.getProjection()));
|
||||||
tile.forDataAtCoordinate(coordinate, callback, null, opt_request);
|
tile.forDataAtCoordinate(coordinate, callback, opt_request);
|
||||||
} else {
|
} else {
|
||||||
if (opt_request === true) {
|
if (opt_request === true) {
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
|
|||||||
Reference in New Issue
Block a user