简体   繁体   English

是否可以在 C# 中计算 Bing Maps Route,然后使用 MvC 将其传递给 Javascript 中的 Map?

[英]Is it possible to calculate a Bing Maps Route in C#, and then pass it to a Map in Javascript using MvC?

I am developing a Web Based Navigation app using Bing Maps and ASP MvC, and I found as well as being able to create a route in the view using JavaScript, it is possible to create a route in the C# controller using the Bing Maps Rest Toolkit, and then pass it over. I am developing a Web Based Navigation app using Bing Maps and ASP MvC, and I found as well as being able to create a route in the view using JavaScript, it is possible to create a route in the C# controller using the Bing Maps Rest Toolkit ,然后将其传递过去。

However, I have been unable to find any information as to how to actually display the passed route on the map, as the directions module that the view uses to create JavaScript has no way to accept a pre-calculated route, and can only create new ones.但是,我一直无法找到有关如何在 map 上实际显示已通过路线的任何信息,因为视图用于创建 JavaScript 的方向模块无法接受预先计算的路线,只能创建新的那些。 I'm just wondering if it is indeed possible to create and show routes this way, and if not, why?我只是想知道是否确实可以以这种方式创建和显示路线,如果没有,为什么?

The directions manager in the Bing Maps JavaScript SDK does not support passing in a precalculated route. Bing 地图 JavaScript SDK 中的路线管理器不支持通过预先计算的路线。 You will need to pass over all the route options and let the directions manager calculate the route.您将需要传递所有路线选项并让路线经理计算路线。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM