Skip to content

Commit 2f608ff

Browse files
authored
fix linestring/polygon getExtent undefined error fix #1302 (#1391)
1 parent 8b31490 commit 2f608ff

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/geometry/Path.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -388,6 +388,10 @@ class Path extends Geometry {
388388
}
389389

390390
_coords2Extent(coords, proj) {
391+
// linestring, polygon
392+
if (!coords || coords.length === 0 || (Array.isArray(coords[0]) && coords[0].length === 0)) {
393+
return null;
394+
}
391395
const result = new Extent(proj);
392396
for (let i = 0, l = coords.length; i < l; i++) {
393397
for (let j = 0, ll = coords[i].length; j < ll; j++) {

0 commit comments

Comments
 (0)