0

我正在使用以下代码查找两个地方之间的距离,但速度很慢大约需要 1 分钟。

MapPoint.Application objApp = new MapPoint.Application();
        MapPoint.Map objMap = null;
        objMap = objApp.ActiveMap;
        Object obj1 = 1;
        objMap.ActiveRoute.Waypoints.Add(objMap.FindResults(txtfrom.Text)
           .get_Item(ref obj1), "");
        objMap.ActiveRoute.Waypoints.Add(objMap.FindResults(txtTo.Text)
           .get_Item(ref obj1), "");
        objMap.ActiveRoute.Calculate();
        txtMiles.Text = objMap.ActiveRoute.Distance.ToString();
4

1 回答 1

0

Hi use this following code

Instead of .active route calculation

enter image description here

use c as like this way otherwise :var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a));

于 2013-12-22T19:49:39.480 回答