Skip to content

Commit

Permalink
feat: add downloadConfig to layer
Browse files Browse the repository at this point in the history
  • Loading branch information
LukasLohoff committed Oct 13, 2022
1 parent 7a2f1c7 commit 2105f5d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/model/Layer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ export interface DefaultLayerPropertyConfig {
visible?: boolean;
}

export interface DownloadConfig {
downloadUrl: string;
formatName: string;
}

export interface DefaultLayerClientConfig {
minResolution?: number;
maxResolution?: number;
Expand All @@ -33,6 +38,7 @@ export interface DefaultLayerClientConfig {
propertyConfig?: DefaultLayerPropertyConfig[];
crossOrigin?: string;
opacity?: number;
downloadConfig?: DownloadConfig[];
}

export interface LayerArgs extends BaseEntityArgs {
Expand Down
5 changes: 5 additions & 0 deletions src/parser/SHOGunApplicationUtil.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,10 @@ describe('SHOGunApplicationUtil', () => {
displayName: 'id',
visible: true
}],
downloadConfig: [{
downloadUrl: 'https://example.com/geo/ows?request=GetFeature&outputFormat=application%2Fjson',
formatName: 'GeoJSON'
}],
searchable: true
},
sourceConfig: {
Expand Down Expand Up @@ -174,6 +178,7 @@ describe('SHOGunApplicationUtil', () => {
expected.set('type', myLayer.type);
expected.set('searchable', myLayer.clientConfig?.searchable);
expected.set('propertyConfig', myLayer.clientConfig?.propertyConfig);
expected.set('downloadConfig', myLayer.clientConfig?.downloadConfig);
expected.set('legendUrl', myLayer.sourceConfig.legendUrl);
expected.set('hoverable', myLayer.clientConfig?.hoverable);

Expand Down
1 change: 1 addition & 0 deletions src/parser/SHOGunApplicationUtil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,7 @@ class SHOGunApplicationUtil<T extends Application, S extends Layer> {
olLayer.set('type', layer.type);
olLayer.set('searchable', layer.clientConfig?.searchable);
olLayer.set('propertyConfig', layer.clientConfig?.propertyConfig);
olLayer.set('downloadConfig', layer.clientConfig?.downloadConfig);
olLayer.set('legendUrl', layer.sourceConfig.legendUrl);
olLayer.set('hoverable', layer.clientConfig?.hoverable);
olLayer.set('useBearerToken', layer.sourceConfig?.useBearerToken);
Expand Down

0 comments on commit 2105f5d

Please sign in to comment.