Skip to content

Commit

Permalink
Adds wfsFormatOptions prop to WfsSearch
Browse files Browse the repository at this point in the history
  • Loading branch information
KaiVolland committed Apr 11, 2018
1 parent b1e6199 commit f9830be
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/Field/WfsSearch/WfsSearch.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,12 @@ export class WfsSearch extends React.Component {
* 'same-origin' as default but can be overwritten.
* @type {object}
*/
additionalFetchOptions: PropTypes.object
additionalFetchOptions: PropTypes.object,
/**
* Options which are passed to the constructor of the ol.format.WFS.
* compare: http://openlayers.org/en/latest/apidoc/ol.format.WFS.html
*/
wfsFormatOptions: PropTypes.object
}

static defaultProps = {
Expand Down Expand Up @@ -233,7 +238,8 @@ export class WfsSearch extends React.Component {
propertyNames,
srsName,
baseUrl,
additionalFetchOptions
additionalFetchOptions,
wfsFormatOptions
} = this.props;

const options = {
Expand All @@ -248,7 +254,7 @@ export class WfsSearch extends React.Component {
filter: this.createFilter()
};

const wfsFormat = new OlFormatWFS();
const wfsFormat = new OlFormatWFS(wfsFormatOptions);
const featureRequest = wfsFormat.writeGetFeature(options);
this.setState({fetching: true});

Expand Down Expand Up @@ -354,6 +360,7 @@ export class WfsSearch extends React.Component {
renderOption,
searchAttributes,
srsName,
wfsFormatOptions,
...passThroughProps
} = this.props;

Expand Down

0 comments on commit f9830be

Please sign in to comment.