geotiff.js icon indicating copy to clipboard operation
geotiff.js copied to clipboard

AbortSignal does not work when GeoTIFF constructors used

Open anton-seaice opened this issue 2 years ago • 0 comments

In geotiff.js all the calls to GeoTIFF.fromSource are passing the abort signal to options.

fromSource is defined at line 546, and signal is the third argument:

 /**
   * Parse a (Geo)TIFF file from the given source.
   *
   * @param {*} source The source of data to parse from.
   * @param {GeoTIFFOptions} [options] Additional options.
   * @param {AbortSignal} [signal] An AbortSignal that may be signalled if the request is
   *                               to be aborted
   */
  static async fromSource(source, options, signal) {

However, all calls lower in the file using signal as the second argument: e.g. line 683

export async function fromUrl(url, options = {}, signal) {
  return GeoTIFF.fromSource(makeRemoteSource(url, options), signal);
}

And about 6 more examples do the same thing below that in the same file.

I suggest changing the order of the arguments for fromSource so it becomes static async fromSource(source, signal, options) ??

anton-seaice avatar Nov 01 '22 04:11 anton-seaice