Skip to content

Commit

Permalink
[2.19.x] G-9033 fix Saved search form fails to display Geometry (#6345)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewzimmer authored Oct 1, 2020
1 parent a2b6f5d commit dc0adb9
Showing 1 changed file with 16 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ class LocationInput extends React.Component {
this.props.listenTo(this.locationModel, 'change:mode', () => {
this.clearLocation()
})
this.props.listenTo(this.locationModel, 'change:polygon', () => {
if (this.locationModel.get('mode') !== 'poly') {
wreqr.vent.trigger('search:polydisplay', this.locationModel)
}
})
}
componentWillUnmount() {
this.locationModel.off('change', this.setModelState)
Expand All @@ -104,9 +109,10 @@ class LocationInput extends React.Component {
switch (filter.type) {
// these cases are for when the model matches the filter model
case 'DWITHIN':
if (CQLUtils.isPointRadiusFilter(filter.value)) {
const value = filter.value && filter.value.value ? filter.value : filter
if (CQLUtils.isPointRadiusFilter(value)) {
wreqr.vent.trigger('search:circledisplay', this.locationModel)
} else if (CQLUtils.isPolygonFilter(filter.value)) {
} else if (CQLUtils.isPolygonFilter(value)) {
wreqr.vent.trigger('search:polydisplay', this.locationModel)
} else {
wreqr.vent.trigger('search:linedisplay', this.locationModel)
Expand All @@ -116,7 +122,14 @@ class LocationInput extends React.Component {
if (CQLUtils.isLineFilter(filter)) {
wreqr.vent.trigger('search:linedisplay', this.locationModel)
} else {
wreqr.vent.trigger('search:polydisplay', this.locationModel)
if (
filter.geojson &&
filter.geojson.properties.type === 'BoundingBox'
) {
wreqr.vent.trigger('search:bboxdisplay', this.locationModel)
} else {
wreqr.vent.trigger('search:polydisplay', this.locationModel)
}
}
break
// these cases are for when the model matches the location model
Expand Down

0 comments on commit dc0adb9

Please sign in to comment.