Skip to content

Commit

Permalink
Replaced exclude options with include options on GetFeatureInfo WMS
Browse files Browse the repository at this point in the history
  • Loading branch information
allyoucanmap committed Jan 27, 2017
1 parent c811fa0 commit c9bc8c7
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 41 deletions.
8 changes: 4 additions & 4 deletions web/client/components/data/identify/Identify.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const Identify = React.createClass({
changeMousePointer: React.PropTypes.func,
maxItems: React.PropTypes.number,
excludeParams: React.PropTypes.array,
excludeOptions: React.PropTypes.array,
includeOptions: React.PropTypes.array,
showRevGeocode: React.PropTypes.func,
hideRevGeocode: React.PropTypes.func,
showModalReverse: React.PropTypes.bool,
Expand Down Expand Up @@ -99,7 +99,7 @@ const Identify = React.createClass({
layers: [],
maxItems: 10,
excludeParams: ["SLD_BODY"],
excludeOptions: ["origin"],
includeOptions: [],
panelClassName: "panel default-panel",
headerClassName: "panel-heading",
bodyClassName: "panel-body",
Expand Down Expand Up @@ -227,10 +227,10 @@ const Identify = React.createClass({
return false;
},
filterRequestParams(layer) {
let excludeOpt = this.props.excludeOptions || [];
let includeOpt = this.props.includeOptions || [];
let excludeList = this.props.excludeParams || [];
let options = Object.keys(layer).reduce((op, next) => {
if (next !== "params" && excludeOpt.indexOf(next) === -1) {
if (next !== "params" && includeOpt.indexOf(next) !== -1) {
op[next] = layer[next];
}else if (next === "params" && excludeList.length > 0) {
let params = layer[next];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ describe('Identify', () => {
const identify = ReactDOM.render(
<Identify
excludeParams={["ONLY_GETMAP"]}
excludeOptions={["INTERNAL_OPTION"]}
includeOptions={["WMS_PARAMETER_TO_SHARE", "WMS_OPTION"]}
enableRevGeocode={true}
queryableLayersFilter={() => true}
point={{latlng: {lat: 40, lng: 10}}}
Expand Down
47 changes: 11 additions & 36 deletions web/client/localConfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -282,23 +282,11 @@
},
"collapsible": false
},
"excludeOptions": [
"search",
"links",
"allowedSRS",
"title",
"type",
"visibility",
"params",
"legend",
"statistics",
"columnDefs",
"advancedFilter",
"boundingBox",
"capabilities",
"describeCoverage",
"describeLayer",
"loading"
"includeOptions": [
"buffer",
"cql_filter",
"filter",
"propertyName"
]
}
},
Expand Down Expand Up @@ -618,25 +606,12 @@
"maxHeight": "70%",
"marginBottom": 0
},
"excludeOptions": [
"search",
"links",
"allowedSRS",
"title",
"type",
"visibility",
"params",
"legend",
"statistics",
"columnDefs",
"advancedFilter",
"boundingBox",
"capabilities",
"describeCoverage",
"describeLayer",
"loading"

],
"includeOptions": [
"buffer",
"cql_filter",
"filter",
"propertyName"
],
"draggable": false,
"collapsible": true,
"viewerOptions": {
Expand Down

0 comments on commit c9bc8c7

Please sign in to comment.