Skip to content

Commit

Permalink
use multiple subdomains to speed up loading
Browse files Browse the repository at this point in the history
  • Loading branch information
kylerchin committed Dec 9, 2024
1 parent d4b4ad2 commit 6ae7393
Showing 1 changed file with 19 additions and 5 deletions.
24 changes: 19 additions & 5 deletions src/components/setup_load_map.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
});

Expand Down

0 comments on commit 6ae7393

Please sign in to comment.