Skip to content

Commit aab62e7

Browse files
stepankuzminmourner
authored andcommitted
Add ImageProvider (internal-2363)
1 parent f229beb commit aab62e7

13 files changed

+485
-282
lines changed

debug/landmark-icons.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
},
4444
'mapbox-landmarks': {
4545
type: 'raster-array',
46-
url: 'mapbox://mapbox.mbx-landmark-icons-v1-staging',
46+
url: 'mapbox://mapbox.mapbox-landmark-icons-v1',
4747
}
4848
};
4949

src/data/mrt/mrt.esm.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -899,7 +899,9 @@ class MapboxRasterLayer {
899899
default:
900900
throw new MRTError(`Invalid band \`${JSON.stringify(band)}\`. Expected string or integer.`);
901901
}
902-
throw new MRTError(`Band not found: ${JSON.stringify(band)}`);
902+
903+
// If we reach here, the band was not found
904+
return {blockIndex: -1, blockBandIndex: -1};
903905
}
904906

905907
/**
@@ -974,6 +976,10 @@ class MapboxRasterLayer {
974976
blockBandIndex
975977
} = this.getBlockForBand(band);
976978

979+
if (blockIndex < 0) {
980+
throw new MRTError(`Band not found: ${JSON.stringify(band)}`);
981+
}
982+
977983
/** @type {Uint8Array} */
978984
const blockData = this._decodedBlocks.get(blockIndex.toString());
979985
if (!blockData) {

0 commit comments

Comments
 (0)