根据旅行商示例,调用自己发布的交通分析服务,返回错误信息SuperMap.Util.RequestJSONP.supermap_callbacks[9189430990497424]({"succeed":false,"error":{"code":400,"errorMsg":"执行 findPath 操作时出错,原因是:权重字段length不存在。 "}},400),请教下,这个是因为什么出问题?需要去翻源码吗? 在iServer服务管理中,/iserver/services/transportationAnalyst-netsl/rest/networkanalyst/BuildNetworkSL@NetSL/path这个地址中输入参数能返回结果。但是SuperMap.REST.FindPathService这个rest的ur是下面这个,报错为上方内容
http://XXXX/iserver/services/transportationAnalyst-netsl/rest/networkanalyst/BuildNetworkSL@NetSL/path.jsonp?&hasLeastEdgeCount=false¶meter={'resultSetting':XXXX{'returnEdgeFeatures':true,'returnEdgeGeometry':true,'returnEdgeIDs':true,'returnNodeFeatures':true,'returnNodeGeometry':true,'returnNodeIDs':true,'returnPathGuides':true,'returnRoutes':true},'weightFieldName':"length",'barrierEdgeIDs':null,'barrierNodeIDs':null,'barrierPoints':null,'turnWeightField':null}&nodes=[{"x":109.35892,"y":33.283115},{"x":109.15892,"y":33.483115},{"x":109.65892,"y":33.683115},{"x":109.95892,"y":33.883115}]&callback=SuperMap.Util.RequestJSONP.supermap_callbacks[1593520416778211]§ionCount=1§ionIndex=0&jsonpUserID=1593520416776
你好,旅行商分析的话您可以参考官网范例,检查一下你的参数设置是否正确 https://iclient.supermap.io/10.0.1/examples/classic/editor.html#analysis_findTSPPaths
#analysis_findTSPPaths示例的URL:
https://iserver.supermap.io/iserver/services/transportationanalyst-sample/rest/networkanalyst/RoadNet@Changchun/tsppath.jsonp?¶meter={'resultSetting':{'returnEdgeFeatures':true,'returnEdgeGeometry':true,'returnEdgeIDs':true,'returnNodeFeatures':true,'returnNodeGeometry':true,'returnNodeIDs':true,'returnPathGuides':true,'returnRoutes':true},'weightFieldName':"length",'barrierEdgeIDs':null,'barrierNodeIDs':null,'barrierPoints':null,'turnWeightField':null}&endNodeAssigned=false&nodes=[{"x":1043.7270722864,"y":-776.69332419096},{"x":1043.7270722864,"y":-776.69332419096},{"x":1137.8766720715,"y":-1082.6795234924},{"x":1292.5510145755,"y":-1439.1030083931},{"x":1625.4370995299,"y":-2313.3492921115},{"x":1316.0884145218,"y":-2236.0121208595},{"x":929.40255826168,"y":-1896.401064492}]&callback=SuperMap.Util.RequestJSONP.supermap_callbacks[12945317563755334]§ionCount=1§ionIndex=0&jsonpUserID=1593568189524 我的URL:
http://10.XX.XX.XXX:8090/iserver/services/transportationAnalyst-netsl/rest/networkanalyst/BuildNetworkSL@NetSL/path.jsonp?&hasLeastEdgeCount=false¶meter={'resultSetting':{'returnEdgeFeatures':true,'returnEdgeGeometry':true,'returnEdgeIDs':true,'returnNodeFeatures':true,'returnNodeGeometry':true,'returnNodeIDs':true,'returnPathGuides':true,'returnRoutes':true},'weightFieldName':"length",'barrierEdgeIDs':null,'barrierNodeIDs':null,'barrierPoints':null,'turnWeightField':null}&nodes=[{"x":109.35892,"y":33.283115},{"x":109.15892,"y":33.483115},{"x":109.65892,"y":33.683115},{"x":109.95892,"y":33.883115}]&callback=SuperMap.Util.RequestJSONP.supermap_callbacks[1593568310297654]§ionCount=1§ionIndex=0&jsonpUserID=1593568310293