Skip to content

Commit a309405

Browse files
committed
Fix status bar loading when adding landmark
1 parent 8762121 commit a309405

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

packages/base/src/mainview/mainView.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -996,7 +996,8 @@ export class MainView extends React.Component<IProps, IStates> {
996996
let sourceId: string | undefined;
997997
let source: IJGISSource | undefined;
998998

999-
if (layer.type !== 'StacLayer') {
999+
// Sourceless layers
1000+
if (!['StacLayer', 'LandmarkLayer'].includes(layer.type)) {
10001001
sourceId = layer.parameters?.source;
10011002
if (!sourceId) {
10021003
return;
@@ -1206,7 +1207,6 @@ export class MainView extends React.Component<IProps, IStates> {
12061207
item => item.id === id && item.error === error.message,
12071208
)
12081209
) {
1209-
this._loadingLayers.delete(id);
12101210
return;
12111211
}
12121212

@@ -1220,7 +1220,9 @@ export class MainView extends React.Component<IProps, IStates> {
12201220
error: error.message || 'invalid file path',
12211221
index,
12221222
});
1223+
} finally {
12231224
this._loadingLayers.delete(id);
1225+
this.setState(old => ({ ...old, loadingLayer: false }));
12241226
}
12251227
}
12261228

@@ -1600,10 +1602,12 @@ export class MainView extends React.Component<IProps, IStates> {
16001602
* @param layer The Layer to check
16011603
*/
16021604
private _waitForSourceReady(layer: Layer | LayerGroup) {
1605+
console.log('wait start');
16031606
return new Promise<void>((resolve, reject) => {
16041607
const checkState = () => {
16051608
const state = layer.getSourceState();
16061609
if (state === 'ready') {
1610+
console.log('wait resolve');
16071611
layer.un('change', checkState);
16081612
resolve();
16091613
} else if (state === 'error') {

0 commit comments

Comments
 (0)