Skip to content

Commit

Permalink
feature: filter on wms layer
Browse files Browse the repository at this point in the history
  • Loading branch information
johnnyblasta committed Mar 24, 2023
1 parent 288fd34 commit 166fd01
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/layer/wms.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ function createTileSource(options) {
TILED: true,
VERSION: options.version,
FORMAT: options.format,
STYLES: options.style
STYLES: options.style,
CQL_FILTER: options.filter
}
}));
}
Expand All @@ -32,7 +33,8 @@ function createImageSource(options) {
LAYERS: options.id,
VERSION: options.version,
FORMAT: options.format,
STYLES: options.style
STYLES: options.style,
CQL_FILTER: options.filter
}
}));
}
Expand Down Expand Up @@ -103,6 +105,7 @@ const wms = function wms(layerOptions, viewer) {
sourceOptions.crossOrigin = wmsOptions.crossOrigin ? wmsOptions.crossOrigin : sourceOptions.crossOrigin;
sourceOptions.projection = viewer.getProjection();
sourceOptions.id = wmsOptions.id;
sourceOptions.filter = wmsOptions.filter;
sourceOptions.format = wmsOptions.format ? wmsOptions.format : sourceOptions.format;
const styleSettings = viewer.getStyle(wmsOptions.styleName);
const wmsStyleObject = styleSettings ? styleSettings[0].find(s => s.wmsStyle) : undefined;
Expand Down

0 comments on commit 166fd01

Please sign in to comment.