首页 / 浏览问题 / WebGIS / 问题详情
Leaflet等值线提取代码无法显示结果
3EXP 2021年08月09日

问题和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();

1个回答

您好,有报错信息吗,对比iserver检查一下参数填写是否正确呢
1,000EXP 2021年08月09日
...