问题和http://ask.supermap.com/97351相似,serviceResult.result是undefined,在iServer上直接填写参数分析可以成功,但网页代码无法显示结果,裁剪范围设置为null。
关键代码:
//等值线提取
var spaAnaUrl="http://localhost:8090/iserver/services/spatialAnalysis-ChinaClimate/restjsr/spatialanalyst";
function surfaceAnalystProcess() {
surfaceAnalystParameters = new SuperMap.DatasetSurfaceAnalystParameters({
extractParameter: new SuperMap.SurfaceAnalystParametersSetting({
datumValue: 15,
interval: 4,
resampleTolerance: 0,
smoothMethod: SuperMap.SmoothMethod.BSPLINE,
smoothness: 3,
clipRegion: null
}),
dataset: "China_ProCenCity_pt@ChinaClimate",
resolution: 9000,
zValueFieldName: "温度04_30"
});
surfaceAnalystService = L.supermap.spatialAnalystService(spaAnaUrl);
surfaceAnalystService.surfaceAnalysis(surfaceAnalystParameters, function (serviceResult) {
var result = serviceResult.result;
if (result && result.recordset && result.recordset.features) {
resultLayer = L.geoJSON(L.Util.transform(serviceResult.result.features, L.CRS.EPSG3857, L.CRS.EPSG4326), {weight: 3}).addTo(map);
}
else {
alert(serviceResult.error.errorMsg);
}
});
}
surfaceAnalystProcess();