Skip to content

Commit 67e9a55

Browse files
committed
move source_type to prefix conversion up
1 parent 33a4022 commit 67e9a55

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/essence/Basics/Layers_/Layers_.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3631,6 +3631,15 @@ async function parseConfig(configData, urlOnLayers) {
36313631

36323632
//Iterate over each layer
36333633
for (let i = 0; i < d.length; i++) {
3634+
// If sourceType, prefix onto url
3635+
if (
3636+
d[i].sourceType != null &&
3637+
d[i].sourceType !== 'url' &&
3638+
d[i].url.indexOf(`${d[i].sourceType}:`) !== 0
3639+
) {
3640+
d[i].url = `${d[i].sourceType}:${d[i].url}`
3641+
}
3642+
36343643
// check if this is a vector STAC catalog or collection
36353644
// if so, prefetch the data and replace this entry
36363645
if (d[i].type === 'vector' && stacRegex.test(d[i].url)) {
@@ -3648,15 +3657,6 @@ async function parseConfig(configData, urlOnLayers) {
36483657
d[i] = { display_name: d[i].name, ...d[i] }
36493658
d[i].name = d[i].uuid || d[i].name
36503659

3651-
// If sourceType, prefix onto url
3652-
if (
3653-
d[i].sourceType != null &&
3654-
d[i].sourceType !== 'url' &&
3655-
d[i].url.indexOf(`${d[i].sourceType}:`) !== 0
3656-
) {
3657-
d[i].url = `${d[i].sourceType}:${d[i].url}`
3658-
}
3659-
36603660
// Create parsed layers named
36613661
L_.layers.data[d[i].name] = d[i]
36623662

@@ -3947,7 +3947,7 @@ async function parseConfig(configData, urlOnLayers) {
39473947
error: (resp) => {
39483948
console.warn(resp)
39493949
resolve(d)
3950-
}
3950+
},
39513951
})
39523952
} else {
39533953
resolve(d)

0 commit comments

Comments
 (0)