SuperMap计算两点距离
function measureDistance() { var polyLine = L.polyline([ [25, 102], [40, 116] ], { color: "red" }); var marker1 = L.marker([25, 102]), marker2 = L.marker([40, 116]); polyLine.addTo(map); marker1.addTo(map); marker2.addTo(map); //resultLayer.addLayer(marker1); //resultLayer.addLayer(marker2); var distanceMeasureParam = new SuperMap.MeasureParameters(polyLine); L.supermap .measureService(url) .measureDistance(distanceMeasureParam, function (serviceResult) { var content = "距离:" + serviceResult.result.distance + "米"; console.log(serviceResult.result.distance) }); }
本文来自博客园,作者:ALin_Da,转载请注明原文链接:https://www.cnblogs.com/alinda/p/15728224.html
。 一个programmer小菜鸟的成长记