Skip to content

Commit

Permalink
Merge pull request #919 from jansule/filter-fix
Browse files Browse the repository at this point in the history
fix: actually set xmlns on filter
  • Loading branch information
jansule authored Feb 13, 2024
2 parents 20d7bdf + bc12246 commit 36b7e65
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/SldStyleParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1210,8 +1210,12 @@ export class SldStyleParser implements StyleParser<string> {
const rules: any[] = this.getSldRulesFromRules(geoStylerStyle.rules);
// add the ogc namespace to the filter element, if a filter is present
rules.forEach(rule => {
if (rule.Filter && !rule.Filter['@_xmlns']) {
rule.Filter['@_xmlns'] = 'http://www.opengis.net/ogc';
const ruleEl = get(rule, this.getTagName('Rule'));
const filter = getChildren(ruleEl, 'Filter').at(0);
if (filter) {
filter[':@'] = {
'@_xmlns': 'http://www.opengis.net/ogc'
};
}
});

Expand Down

0 comments on commit 36b7e65

Please sign in to comment.