- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我正在尝试使用虚拟地球网络服务:
http://staging.dev.virtualearth.net/webservices/v1/routeservice/routeservice.svc?wsdl
返回停在多个点的车辆的总行程距离。
我的代码适用于具有 4 个航路点的旅程,但除此之外我会收到以下错误:
The maximum message size quota for incoming messages (65536) has been exceeded. To increase the quota, use the MaxReceivedMessageSize property on the appropriate binding element.
粗略的代码是:(C#控制台应用程序)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Xml;
using System.Text;
using System.Configuration;
using System.Threading;
using System.Text.RegularExpressions;
using altRouteFinder.VEStagingToken;
using altRouteFinder.VERoutingService;
namespace altRouteFinder
{
class Program
{
static void Main(string[] args)
{
waypointString = "53.450356,-2.873335;53.399184,-2.980577;53.440535,-2.864101;53.449368,-2.885361;53.454417,-2.930646;53.450356,-2.873335";
string[] points = waypointString.Split(';');
Waypoint[] waypoints = new Waypoint[points.Length];
double dayDistance = 0;
int pointIndex = -1;
foreach (string point in points)
{
pointIndex++;
waypoints[pointIndex] = new Waypoint();
string[] digits = point.Split(',');
waypoints[pointIndex].Location = new VERoutingService.Location();
waypoints[pointIndex].Location.Latitude = double.Parse(digits[0].Trim());
waypoints[pointIndex].Location.Longitude = double.Parse(digits[1].Trim());
if (pointIndex == 0)
waypoints[pointIndex].Description = "Start";
else if (pointIndex == points.Length)
waypoints[pointIndex].Description = "End";
else
waypoints[pointIndex].Description = string.Format("Stop #{0}", pointIndex);
}
routeRequest.Waypoints = waypoints;
RouteOptions myRouteOptions = new RouteOptions();
//Set travel mode - Driving or Walking
myRouteOptions.Mode = TravelMode.Driving;
//Set the optimization type - MinimizeDistance or MinimizeTime
myRouteOptions.Optimization = RouteOptimization.MinimizeTime;
//Set the use of traffic conditions - TrafficBasedRouteAndTime, TrafficBasedTime, or None
myRouteOptions.TrafficUsage = TrafficUsage.TrafficBasedTime;
//Pass the Route Options to the Route Object
routeRequest.Options = myRouteOptions;
// Make the calculate route request
RouteServiceClient routeService = new RouteServiceClient();
RouteResponse routeResponse = routeService.CalculateRoute(routeRequest);
// Iterate through each itinerary item to get the route directions
StringBuilder directions = new StringBuilder("");
if (routeResponse.Result.Legs.Length > 0)
{
int instructionCount = 0;
int legCount = 0;
foreach (RouteLeg leg in routeResponse.Result.Legs)
{
legCount++;
directions.Append(string.Format("Leg #{0}\n", legCount));
foreach (ItineraryItem item in leg.Itinerary)
{
instructionCount++;
directions.Append(string.Format("{0}. {1} {2}\n",
instructionCount, item.Summary.Distance, item.Text));
dayDistance += item.Summary.Distance;
}
}
//Remove all Bing Maps tags around keywords.
//If you wanted to format the results, you could use the tags
Regex regex = new Regex("<[/a-zA-Z:]*>",
RegexOptions.IgnoreCase | RegexOptions.Multiline);
results = regex.Replace(directions.ToString(), string.Empty);
}
else
results = "No Route found";
Console.WriteLine(results);
Console.WriteLine(dayDistance);
}
}
我不知道在哪里设置 MaxReceivedMessageSize 而且我读到它只适用于 Vista?!
帮助任何人?
最佳答案
我在这里找到了解决方案: link text
maxReceivedMessgeSize 在应用程序的 .config 文件中,即 web.config 或 app.config 等。
关于c# - 如何将多个航路点发送到虚拟地球路由 Web 服务,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/956972/
我正在使用 Google Earth API,而且我是新手。我使用 kml 标记了一个地标,并为此添加了一个点击事件。我想获得这个地标的纬度和经度值。虽然我正在使用 getLatitude() 和 g
我是一名无法理解的设计师。 我正在尝试将静态 Google 地球 map 放入 MySQL 数据库中,以便用户能够登录和访问。我需要用户能够单击几个不同的过滤器,并根据过滤器更改覆盖层。 我发现了一些
我知道我们可以使用 matplotlib 创建简单的 3 维球体,documentation 中包含此类球体的示例. 现在,我们还有一个 warp 方法作为 matplotlib 模块的一部分,它的用
这个问题困扰了我大约 2 天,谷歌并没有帮助我解决这个问题。基本上,下面的代码应该定义气球内的文本。不幸的是,它不是那样工作的。如果 GE 无法处理 KML 中定义的样式,我们最终会得到似乎是后备方案
是否可以使用 Google Earth 在 Qt 中开发应用程序? 例如,我想在我的应用程序中通过 QtGL 将地球(如在谷歌地球中)显示为一个球体。 最佳答案 很明显,您可以将 google ear
尝试将 kml 上传到 google earth 时出现以下解析错误: 第 1 行第 1 列的解析错误:未关闭的 token 代码的开头如下所示: BL
我想添加 KML 文件的最后更新日期/时间,以便在 Google 地球中显示为覆盖图,是否可以这样做? 我会考虑更新 KML 文件中的文本,然后将其显示在谷歌地球中。 非常感谢。 最佳答案 一个技巧是
让我们假设板块构造是错误的,我们的地球随着时间的推移而膨胀,大陆是曾经覆盖一个较小行星整个表面的地 shell 的残余物,海底被挤压出地幔,这是膨胀的一种表现。 http://earthexpansi
我已经安装了 Android 模拟器: http://developer.android.com/sdk/index.html 我现在使用 eclipse 插件启动并运行它。 我想做的是在模拟手机上连
问题 我想用 WebGL 从低轨道(这里 ~300 公里)构建一个现实的地球 View 。也就是说,在网络上,以及它所暗示的一切,而且在移动设备上。不要停止阅读:为了让这变得不那么困难,用户可以到处看
我正在使用 Three.js 作为开发空间模拟器的框架,我正在尝试,但未能让夜灯正常工作。 模拟器可以在这里访问: orbitingeden.com 可以在此处找到运行以下代码段的页面: orbiti
我在 Google 地球中使用气球时遇到问题。我在 map 上有一些标记,单击标记后,会显示一个包含一些数据的气球弹出窗口,现在当我单击该气球的关闭按钮时,也会触发 map 的单击事件,这真的很烦人,
我正在尝试绘制环绕地球的卫星轨道。这是我目前拥有的: 我使用 mpl_toolkits.mplot3d 中的 Axes3D 函数绘制了这个图。理想情况下,我想做的是用具有拓扑结构的实际地球替换简单的球
有没有办法使用 Excel 2007 可用的脚本在工作表中显示 Google 地球 map ? 我使用 Excel 来存储数据,然后生成一个 KML 文件以加载到 Google 地球中,但现在他们希望
Google Maps API 版本 3 不再需要 key 。有 Google 地球 API 吗?如果是这样,为什么会有差异? 更新:Earth API 确实需要 key ,但我仍然不知道为什么。 最
我目前正在从事一个使用 Google Earth API library that is wrapped in java 的项目这样人们就可以使用 Google Web Toolkit 中的这个库来制
我目前正在从事一个项目,我们需要创建一项新功能,允许用户放大嵌入网络应用程序中的 Google 地球 map ,并在 map 上创建网格布局,因此用户应该能够“标记” map 的某些元素,例如,一些特
是否可以将 Google map 功能添加到 .Net Forms 应用程序?似乎有一些展示了如何在 Web 应用程序中执行此操作...但我找不到将 map 嵌入到 fosm 应用程序中、允许缩放和单
我正在探索如何在我为 Linux 编写的 C++ 应用程序中使用 Google 地球。该应用程序将以非常高的分辨率(大约 6000 x 3000 像素)运行。我对 Google Earth 在高分辨率
我想问一下 Google Earth API 是否可用于开发 android 应用程序。如果 google earth api 不适用于 android,是否有任何 map api 可以在 andro
我是一名优秀的程序员,十分优秀!