We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents e5fc860 + 2c64b8b commit a24dd3fCopy full SHA for a24dd3f
app/src/utils/map.ts
@@ -1,3 +1,4 @@
1
+import { isDefined } from '@togglecorp/fujs';
2
import getBbox from '@turf/bbox';
3
import type {
4
FillLayer,
@@ -183,9 +184,14 @@ export function getCountryListBoundingBox(countryList: Country[]) {
183
184
return undefined;
185
}
186
187
+ const countryWithBbox = countryList.filter((country) => isDefined(country.bbox));
188
+
189
+ if (countryWithBbox.length < 1) {
190
+ return undefined;
191
+ }
192
const collection = {
193
type: 'FeatureCollection' as const,
- features: countryList.map((country) => ({
194
+ features: countryWithBbox.map((country) => ({
195
type: 'Feature' as const,
196
geometry: country.bbox,
197
})),
0 commit comments