Skip to content

Commit 98bf72e

Browse files
committed
fix UT. review by caoxinke.
1 parent 50cfda3 commit 98bf72e

File tree

7 files changed

+21
-25
lines changed

7 files changed

+21
-25
lines changed

dist/iclient9-leaflet.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3957,11 +3957,10 @@ var SpatialAnalystBase = exports.SpatialAnalystBase = function (_CommonServiceBa
39573957
if (result && me.format === _REST.DataFormat.GEOJSON && typeof me.toGeoJSONResult === 'function') {
39583958
//批量分析时会返回多个结果
39593959
if (_Util.Util.isArray(result)) {
3960-
analystResult = [];
3961-
result.map(function (item) {
3962-
analystResult.push(me.toGeoJSONResult(item));
3963-
return item;
3964-
});
3960+
for (var i = 0; i < result.length; i++) {
3961+
result[i] = me.toGeoJSONResult(result[i]);
3962+
}
3963+
analystResult = result;
39653964
} else {
39663965
analystResult = me.toGeoJSONResult(result);
39673966
}

dist/iclient9-leaflet.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/iclient9-mapboxgl.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3929,11 +3929,10 @@ var SpatialAnalystBase = exports.SpatialAnalystBase = function (_CommonServiceBa
39293929
if (result && me.format === _REST.DataFormat.GEOJSON && typeof me.toGeoJSONResult === 'function') {
39303930
//批量分析时会返回多个结果
39313931
if (_Util.Util.isArray(result)) {
3932-
analystResult = [];
3933-
result.map(function (item) {
3934-
analystResult.push(me.toGeoJSONResult(item));
3935-
return item;
3936-
});
3932+
for (var i = 0; i < result.length; i++) {
3933+
result[i] = me.toGeoJSONResult(result[i]);
3934+
}
3935+
analystResult = result;
39373936
} else {
39383937
analystResult = me.toGeoJSONResult(result);
39393938
}

dist/iclient9-mapboxgl.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/iclient9-openlayers.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4236,11 +4236,10 @@ var SpatialAnalystBase = exports.SpatialAnalystBase = function (_CommonServiceBa
42364236
if (result && me.format === _REST.DataFormat.GEOJSON && typeof me.toGeoJSONResult === 'function') {
42374237
//批量分析时会返回多个结果
42384238
if (_Util.Util.isArray(result)) {
4239-
analystResult = [];
4240-
result.map(function (item) {
4241-
analystResult.push(me.toGeoJSONResult(item));
4242-
return item;
4243-
});
4239+
for (var i = 0; i < result.length; i++) {
4240+
result[i] = me.toGeoJSONResult(result[i]);
4241+
}
4242+
analystResult = result;
42444243
} else {
42454244
analystResult = me.toGeoJSONResult(result);
42464245
}

dist/iclient9-openlayers.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/common/iServer/SpatialAnalystBase.js

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,13 @@ export class SpatialAnalystBase extends CommonServiceBase {
4444
result = Util.transformResult(result);
4545
if (result && me.format === DataFormat.GEOJSON && typeof me.toGeoJSONResult === 'function') {
4646
//批量分析时会返回多个结果
47-
if(Util.isArray(result)){
48-
analystResult = [];
49-
result.map(function (item) {
50-
analystResult.push(me.toGeoJSONResult(item));
51-
return item;
52-
});
47+
if (Util.isArray(result)) {
48+
for (var i = 0; i < result.length; i++) {
49+
result[i] = me.toGeoJSONResult(result[i])
50+
}
51+
analystResult = result;
5352

54-
}else {
53+
} else {
5554
analystResult = me.toGeoJSONResult(result);
5655
}
5756
}

0 commit comments

Comments
 (0)