使用产品:supermap iclient 10i 操作系统:win10 x64 数据类型:文件型 问题详细描述:
nodes列表是最佳路径分析中的,我这样写并没有成功生成路径
你好,最佳路径分析中设置参数SuperMap.FindPathParameters.isAnalyzeById = false 时,nodes 应为点的坐标数组。
您好,我看实例里面,nodes数组是若干L.point构成的,且和marker设置的横纵坐标是相反的,我现在想知道能否有方法直接把已有的marker添加进nodes中?我问题中是想把marker转为point……
function findPathProcess() { //添加站点 var marker1 = L.marker([-3000, 4000]).addTo(map); marker1.bindPopup(resources.text_site1); var marker2 = L.marker([-2500, 5500]).addTo(map); marker2.bindPopup(resources.text_site2); var marker3 = L.marker([-4000, 6900]).addTo(map); marker3.bindPopup(resources.text_site3); //创建最佳路径分析服务实例 findPathService = L.supermap.networkAnalystService(serviceUrl); //创建最佳路径分析参数实例 var resultSetting = new SuperMap.TransportationAnalystResultSetting({ returnEdgeFeatures: true, returnEdgeGeometry: true, returnEdgeIDs: true, returnNodeFeatures: true, returnNodeGeometry: true, returnNodeIDs: true, returnPathGuides: true, returnRoutes: true }); var analystParameter = new SuperMap.TransportationAnalystParameter({ resultSetting: resultSetting, weightFieldName: "length" }); findPathParameter = new SuperMap.FindPathParameters({ isAnalyzeById: false, nodes: [L.point(4000, -3000), L.point(5500, -2500), L.point(6900, -4000)], parameter: analystParameter }); var myIcon = L.icon({ iconUrl: "../img/walk.png", iconSize: [20, 20] }); //进行查找 findPathService.findPath(findPathParameter, function (serviceResult) { var result = serviceResult.result; result.pathList.map(function (result) { L.geoJSON(result.route).addTo(map); L.geoJSON(result.pathGuideItems, { pointToLayer: function (geoPoints, latlng) { L.marker(latlng, { icon: myIcon }).addTo(map); }, filter: function (geoJsonFeature) { if (geoJsonFeature.geometry && geoJsonFeature.geometry.type === 'Point') { return true; } return false; } }).addTo(map); }) }); }
你是想marker转point对吧。marker1._latlng