fix debug.html sources (#853)

This commit is contained in:
Yuri Astrakhan 2023-08-30 03:19:33 -04:00 committed by GitHub
parent 197e9e3f07
commit 9d8c8c948e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -224,12 +224,12 @@
}
map.on('load', async function () {
const sources = Object.values(await fetch(
'http://0.0.0.0:3000/catalog'
).then((r) => r.json()));
const catalog = await fetch('http://0.0.0.0:3000/catalog');
const sources = (await catalog.json()).tiles;
// Set up the corresponding toggle button for each layer.
for (const [id, source] of Object.entries(sources.tiles)) {
// TODO: we may want to show each source metadata on hover or some other way?
for (const [id, source] of Object.entries(sources)) {
// Skip layers that already have a button set up.
if (document.getElementById(id)) {
continue;