Skip to content

Commit 4822d14

Browse files
committed
Fix location search in filter UI (add the geometry to the filter params)
1 parent 6edb0a0 commit 4822d14

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/components/filters/location.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,13 +206,19 @@ const LocationSelect = props => {
206206

207207
const tolerance =
208208
area(selectedOption.value) / 10 ** 6 < 1000 ? 0.01 : 0.1;
209-
const simplified_bounds = simplify(selectedOption.value, {
209+
const simplified_geometry = simplify(selectedOption.value, {
210210
tolerance: tolerance,
211211
highQuality: true
212212
});
213213

214+
onChange(
215+
'geometry',
216+
fromJS([{ label: simplified_geometry, value: simplified_geometry }])
217+
);
218+
onChange('in_bbox', null);
219+
214220
updateMap(
215-
truncate(simplified_bounds, { precision: 6, coordinates: 2 })
221+
truncate(simplified_geometry, { precision: 6, coordinates: 2 })
216222
);
217223
}
218224
},

0 commit comments

Comments
 (0)