From 6ae7393c8b73963ebc1e2901b775e7f619b93614 Mon Sep 17 00:00:00 2001 From: Kyler Chin <7539174+kylerchin@users.noreply.github.com> Date: Sun, 8 Dec 2024 20:32:52 -0800 Subject: [PATCH] use multiple subdomains to speed up loading --- src/components/setup_load_map.ts | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/src/components/setup_load_map.ts b/src/components/setup_load_map.ts index cea3473..084779d 100644 --- a/src/components/setup_load_map.ts +++ b/src/components/setup_load_map.ts @@ -114,31 +114,45 @@ export async function setup_load_map( map.addSource('foamertiles', { type: 'raster', - tiles: ['https://a.tiles.openrailwaymap.org/standard/{z}/{x}/{y}.png'], + tiles: ['https://a.tiles.openrailwaymap.org/standard/{z}/{x}/{y}.png', + 'https://b.tiles.openrailwaymap.org/standard/{z}/{x}/{y}.png', + 'https://c.tiles.openrailwaymap.org/standard/{z}/{x}/{y}.png'], tileSize: 256 }); map.addSource('maxspeedtiles', { type: 'raster', - tiles: ['https://a.tiles.openrailwaymap.org/maxspeed/{z}/{x}/{y}.png'], + tiles: ['https://a.tiles.openrailwaymap.org/maxspeed/{z}/{x}/{y}.png', + 'https://b.tiles.openrailwaymap.org/maxspeed/{z}/{x}/{y}.png', + 'https://c.tiles.openrailwaymap.org/maxspeed/{z}/{x}/{y}.png' + ], tileSize: 256 }); map.addSource('signallingtiles', { type: 'raster', - tiles: ['https://a.tiles.openrailwaymap.org/signals/{z}/{x}/{y}.png'], + tiles: ['https://a.tiles.openrailwaymap.org/signals/{z}/{x}/{y}.png', + 'https://b.tiles.openrailwaymap.org/signals/{z}/{x}/{y}.png', + 'https://c.tiles.openrailwaymap.org/signals/{z}/{x}/{y}.png' + ], tileSize: 256 }); map.addSource('electrificationtiles', { type: 'raster', - tiles: ['https://a.tiles.openrailwaymap.org/electrification/{z}/{x}/{y}.png'], + tiles: ['https://a.tiles.openrailwaymap.org/electrification/{z}/{x}/{y}.png', + 'https://b.tiles.openrailwaymap.org/electrification/{z}/{x}/{y}.png', + 'https://c.tiles.openrailwaymap.org/electrification/{z}/{x}/{y}.png' + ], tileSize: 256 }); map.addSource('gaugetiles', { type: 'raster', - tiles: ['https://a.tiles.openrailwaymap.org/gauge/{z}/{x}/{y}.png'], + tiles: ['https://a.tiles.openrailwaymap.org/gauge/{z}/{x}/{y}.png', + 'https://b.tiles.openrailwaymap.org/gauge/{z}/{x}/{y}.png', + 'https://c.tiles.openrailwaymap.org/gauge/{z}/{x}/{y}.png' + ], tileSize: 256 });