Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updateLayerFromServiceIfNeeded doesn't set maxCloudCoverPercent #214

Open
dgostencnik opened this issue Apr 26, 2022 · 0 comments
Open

updateLayerFromServiceIfNeeded doesn't set maxCloudCoverPercent #214

dgostencnik opened this issue Apr 26, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@dgostencnik
Copy link
Collaborator

dgostencnik commented Apr 26, 2022

When layer is updated with default values by calling updateLayerFromServiceIfNeeded, maxCloudCoverPercent is never set. In other words, when you create a layer by using dashboard with cc different than 100, that value will never be used.

 test('params are set by default if not specified', async () => {
    const layer = new S2L2ALayer({
      instanceId: 'INSTANCE_ID',
      layerId: 'LAYER_ID',
    });

    mockNetwork.onGet().replyOnce(200, [
      {
        id: 'LAYER_ID',
        title: 'title',
        description: 'descriptions',
        styles: [{ name: 'default', description: 'Default layer style', evalScript: 'evalscript' }],
        orderHint: 0,
        datasourceDefaults: {
          upsampling: 'BICUBIC',
          mosaickingOrder: 'leastRecent',
          temporal: false,
          maxCloudCoverage: 50,
          previewMode: 'EXTENDED_PREVIEW',
          type: 'S2L2A',
        },
      },
    ]);
    await layer.updateLayerFromServiceIfNeeded();
    expect(mockNetwork.history.get.length).toBe(1);
    expect(layer.maxCloudCoverPercent).toEqual(50);
  });

While this is an easy fix, it will unfortunately require changing a bunch of tests and it might brake a feature or two in eob

@dgostencnik dgostencnik added the bug Something isn't working label Apr 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant