Skip to content

Commit a32e93b

Browse files
Use imagery tiles in priority demo
1 parent 2318192 commit a32e93b

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

  • test/apps/tile-priority-demo

test/apps/tile-priority-demo/app.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ type ViewState = {
3232
maxZoom: number;
3333
};
3434

35-
const BASEMAP_TILE_URL = 'https://a.basemaps.cartocdn.com/rastertiles/voyager/{z}/{x}/{y}.png';
35+
const BASEMAP_TILE_URL =
36+
'https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}';
3637

3738
const MIAMI_VIEW_STATE: ViewState = {
3839
longitude: -80.1918,
@@ -302,7 +303,8 @@ function easeInOutCubic(t: number): number {
302303
}
303304

304305
function makeTileId(url: string): string {
305-
return url.match(/\/(\d+\/\d+\/\d+)\.png/)?.[1].replaceAll('/', '-') || 'tile';
306+
const tilePath = url.match(/\/(\d+)\/(\d+)\/(\d+)(?:\.\w+)?(?:[?#].*)?$/);
307+
return tilePath ? `${tilePath[1]}-${tilePath[3]}-${tilePath[2]}` : 'tile';
306308
}
307309

308310
function DemoPane({

0 commit comments

Comments
 (0)