Skip to content

Commit 0091a5a

Browse files
committed
refactor(Feature): simplify build extent check.
1 parent f9df7ff commit 0091a5a

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/Core/Feature.js

+2-4
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ class Feature {
216216
this.crs = crs;
217217
this.normals = structure3d ? [] : undefined;
218218
this.size = structure3d ? 3 : 2;
219-
if (options.buildExtent) {
219+
if (options.extent) {
220220
// this.crs is final crs projection, is out projection.
221221
// If the extent crs is the same then we use output coordinate (coordOut) to expand it.
222222
this.extent = defaultExtent(options.forcedExtentCrs || this.crs);
@@ -279,9 +279,7 @@ export class FeatureCollection {
279279
this.crs = CRS.formatToEPSG(options.crs);
280280
this.features = [];
281281
this.optionsFeature = options || {};
282-
if (this.optionsFeature.buildExtent) {
283-
this.extent = defaultExtent(options.forcedExtentCrs || this.crs);
284-
}
282+
this.extent = options.buildExtent ? defaultExtent(options.forcedExtentCrs || this.crs) : undefined;
285283
this.translation = new THREE.Vector3();
286284
this.scale = new THREE.Vector3(1, 1, 1);
287285
}

0 commit comments

Comments
 (0)