File tree Expand file tree Collapse file tree
test/apps/tile-priority-demo Expand file tree Collapse file tree Original file line number Diff line number Diff 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
3738const MIAMI_VIEW_STATE : ViewState = {
3839 longitude : - 80.1918 ,
@@ -302,7 +303,8 @@ function easeInOutCubic(t: number): number {
302303}
303304
304305function makeTileId ( url : string ) : string {
305- return url . match ( / \/ ( \d + \/ \d + \/ \d + ) \. p n g / ) ?. [ 1 ] . replaceAll ( '/' , '-' ) || 'tile' ;
306+ const tilePath = url . match ( / \/ ( \d + ) \/ ( \d + ) \/ ( \d + ) (?: \. \w + ) ? (?: [ ? # ] .* ) ? $ / ) ;
307+ return tilePath ? `${ tilePath [ 1 ] } -${ tilePath [ 3 ] } -${ tilePath [ 2 ] } ` : 'tile' ;
306308}
307309
308310function DemoPane ( {
You can’t perform that action at this time.
0 commit comments