从 Bing 地图 AJAX 控件访问 RoutePath

发布于 2024-12-10 10:33:18 字数 423 浏览 5 评论 0 原文

使用 RoutePath 类 http://msdn.microsoft.com/en-us/library/gg427610.aspx" rel="nofollow">Bing 地图 AJAX 控件,版本 7.0?

我已加载方向模块,计算方向并调用 DirectionsManager 类的 getRouteResult 方法。不幸的是,它不返回实际路线的坐标。

最终,我需要构成路线的形状的坐标。

How can I access the RoutePath Class when using the Bing Maps AJAX Control, Version 7.0?

I've loaded the directions module, calculated directions and called the getRouteResult method of the DirectionsManager Class. Unfortunately, it doesn't return the coordinates of the actual route.

Ultimately, I need the coordinates of the shape which makes up the route line.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

七禾 2024-12-17 10:33:18

感谢 Microsoft 的帮助,我找到了 RoutePath 的公开方式。通过以下方式访问 RoutePath:

DirectionsManagerObj.getRouteResult().routeLegs[routeLegIndex]
    .subLegs[subLegIndex].routePath;

假设您有两个路径点,这非常有效。否则,您需要循环遍历routeLegs和subLegs才能获取整个路线。

RouteLeg 表示通过两个航路点的路径。 subLeg 表示通过停止点和途经点(或两个途经点)的路径。 DirectionsManager 类 API 提供了有关此信息的更多详细信息。

Thanks to some help from Microsoft, I've found how RoutePath is exposed. Access RoutePath by:

DirectionsManagerObj.getRouteResult().routeLegs[routeLegIndex]
    .subLegs[subLegIndex].routePath;

This works great assuming you have two waypoints. Otherwise, you'll need to loop through routeLegs and subLegs to get the entire route.

A routeLeg represents the path through two waypoints. A subLeg represents the path through a stop point and via point (or two via points). The DirectionsManager Class API has more detail on this information.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文