带有Bing地图的多个单独的航路点

发布于 2025-01-31 23:02:18 字数 1912 浏览 2 评论 0 原文

我希望您的帮助解决问题。在bing地图上,我试图显示多个源和目的地的目的noreferrer“> bing地图。但是它正在彼此连接。我想要每个源和目的地的单独航天点。

在以下代码中,我想在Waypoint 1(Redmond)和2(西雅图)之间绘制单独的线。 Waypoint2(分类单元)与Waypoint3(Orlando)之间也是一个单独的航路点。我想将图像设计为 ”图像“

    var map = new Microsoft.Maps.Map(document.getElementById('myMap'), {
    /* No need to set credentials if already passed in URL */
    center: new Microsoft.Maps.Location(47.606209, -122.332071),
    zoom: 12
});
Microsoft.Maps.loadModule('Microsoft.Maps.Directions', function () {
    var directionsManager = new Microsoft.Maps.Directions.DirectionsManager(map);
    // Set Route Mode to driving
    directionsManager.setRequestOptions({ routeMode: Microsoft.Maps.Directions.RouteMode.driving });
    var waypoint1 = new Microsoft.Maps.Directions.Waypoint({ address: 'Redmond', location: new Microsoft.Maps.Location(47.67683029174805, -122.1099624633789) });
    var waypoint2 = new Microsoft.Maps.Directions.Waypoint({ address: 'Seattle', location: new Microsoft.Maps.Location(47.59977722167969, -122.33458709716797) });
    var waypoint3 = new Microsoft.Maps.Directions.Waypoint({ address: 'TAXAS', location: new Microsoft.Maps.Location(31.000000, -100.000000) });
    var waypoint4 = new Microsoft.Maps.Directions.Waypoint({ address: 'Orlando', location: new Microsoft.Maps.Location(28.538336, -81.379234) });
    directionsManager.addWaypoint(waypoint1);
    directionsManager.addWaypoint(waypoint2);

    directionsManager.addWaypoint(waypoint3);
     directionsManager.addWaypoint(waypoint4);
    // Set the element in which the itinerary will be rendered
    directionsManager.setRenderOptions({ itineraryContainer: document.getElementById('printoutPanel') });
    directionsManager.calculateDirections();
});

I want your help to resolve the issue. On Bing Map i am trying to display multiple source and destination for the same i used Bing MAP. But it is connecting all the waypoint from each other. I want separate waypoint for each source and destination.

In the below code i want to draw separate line between Waypoint 1 (Redmond) and 2 (Seattle). Also a separate waypoint between Waypoint2 (TAXAS) to waypoint3(Orlando) . I want to design the image as Image

    var map = new Microsoft.Maps.Map(document.getElementById('myMap'), {
    /* No need to set credentials if already passed in URL */
    center: new Microsoft.Maps.Location(47.606209, -122.332071),
    zoom: 12
});
Microsoft.Maps.loadModule('Microsoft.Maps.Directions', function () {
    var directionsManager = new Microsoft.Maps.Directions.DirectionsManager(map);
    // Set Route Mode to driving
    directionsManager.setRequestOptions({ routeMode: Microsoft.Maps.Directions.RouteMode.driving });
    var waypoint1 = new Microsoft.Maps.Directions.Waypoint({ address: 'Redmond', location: new Microsoft.Maps.Location(47.67683029174805, -122.1099624633789) });
    var waypoint2 = new Microsoft.Maps.Directions.Waypoint({ address: 'Seattle', location: new Microsoft.Maps.Location(47.59977722167969, -122.33458709716797) });
    var waypoint3 = new Microsoft.Maps.Directions.Waypoint({ address: 'TAXAS', location: new Microsoft.Maps.Location(31.000000, -100.000000) });
    var waypoint4 = new Microsoft.Maps.Directions.Waypoint({ address: 'Orlando', location: new Microsoft.Maps.Location(28.538336, -81.379234) });
    directionsManager.addWaypoint(waypoint1);
    directionsManager.addWaypoint(waypoint2);

    directionsManager.addWaypoint(waypoint3);
     directionsManager.addWaypoint(waypoint4);
    // Set the element in which the itinerary will be rendered
    directionsManager.setRenderOptions({ itineraryContainer: document.getElementById('printoutPanel') });
    directionsManager.calculateDirections();
});

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

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

发布评论

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

评论(1

青朷 2025-02-07 23:02:18

单个方向管理器一次只能维护单个路线。如果要显示多个断开的路线,则需要每个路线的单独指示管理器。这里有Bing Maps团队的这种情况的官方样本: htttps:htttps:// samples.bingmapsportal.com/?sample=display-multiple-routes

A single directions manager can only maintain a single route at a time. If you want to show multiple, disconnected routes, you will need a separate directions manager for each route. There is an official sample for this scenario from the Bing Maps team here: https://samples.bingmapsportal.com/?sample=display-multiple-routes

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