我正在使用以下代码查找两个地方之间的距离,但速度很慢大约需要 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();