Skip to content

Commit

Permalink
fix typo and add onError in TileLayerCanvasRenderer.loadTileBitmap
Browse files Browse the repository at this point in the history
  • Loading branch information
fuzhenn committed Jul 18, 2024
1 parent 19df737 commit 6b0aad4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/map/Map.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ const REDRAW_OPTIONS_PROPERTIES = ['centerCross', 'fog', 'fogColor', 'debugSky']
* @property {Number} [options.zoomOrigin=null] - zoom origin in container point, e.g. [400, 300]
* @property {Boolean} [options.zoomAnimation=true] - enable zooming animation
* @property {Number} [options.zoomAnimationDuration=330] - zoom animation duration.
* @property {Boolean} [options.panAnimation=true] - continue to animate panning when draging or touching ended.
* @property {Boolean} [options.panAnimation=true] - continue to animate panning when dragging or touching ended.
* @property {Boolean} [options.panAnimationDuration=600] - duration of pan animation.
* @property {Boolean} [options.rotateAnimation=true] - continue to animate rotating when draging or touching rotation ended.
* @property {Boolean} [options.rotateAnimation=true] - continue to animate rotating when dragging or touching rotation ended.
* @property {Boolean} [options.rotateAnimationDuration=800] - duration of rotate animation.
* @property {Boolean} [options.zoomable=true] - whether to enable map zooming.
* @property {Boolean} [options.enableInfoWindow=true] - whether to enable infowindow on this map.
Expand Down
5 changes: 4 additions & 1 deletion src/renderer/layer/tilelayer/TileLayerCanvasRenderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -658,8 +658,11 @@ class TileLayerCanvasRenderer extends CanvasRenderer {
const onLoad = (bitmap) => {
this.onTileLoad(bitmap, tile);
};
const onError = (error, image) => {
this.onTileError(image, tile, error);
};
// @ts-expect-error todo
this.loadTileBitmap(tile['url'], tile, onLoad);
this.loadTileBitmap(tile['url'], tile, onLoad, onError);
} else if (this._tileImageWorkerConn && this.loadTileImage === this.constructor.prototype.loadTileImage) {
this._fetchImage(tileImage, tile);
} else {
Expand Down

0 comments on commit 6b0aad4

Please sign in to comment.