Fix non-native geometries not visible in map layout (#10308)

* Fix non-native geometries not showing up in map layout
* Don't add bbox to edited and parsed geometries
This commit is contained in:
Oreille
2021-12-05 00:47:20 +01:00
committed by GitHub
parent 6d2ab0701c
commit cf09f6cd21
4 changed files with 8 additions and 22 deletions

View File

@@ -82,7 +82,6 @@ export function getParser(options: GeometryOptions): GeoJSONParser {
const geomRaw = entry[options.geometryField];
const geom = geomRaw && parse(geomRaw);
if (!geom) return undefined;
geom.bbox = getBBox(geom);
return geom;
};
}
@@ -99,7 +98,7 @@ export function toGeoJSON(entries: any[], options: GeometryOptions): FeatureColl
for (let i = 0; i < entries.length; i++) {
const geometry = parser(entries[i]);
if (!geometry) continue;
const [a, b, c, d] = geometry.bbox!;
const [a, b, c, d] = getBBox(geometry);
geojson.bbox = expandBBox(geojson.bbox!, [a, b]);
geojson.bbox = expandBBox(geojson.bbox!, [c, d]);
const properties = { ...entries[i] };