c# - 从 utr 执行 Google/Bing map 搜索

标签 c# winforms google-maps bing-maps

我正在从事模拟(找不到更好的词)GPS 的项目。用户可以选择一个州、城市和地址,例如 000 someadress.dr,我将其设置为当单击提交按钮时,所有这些组件都组合成一个字符串。我想知道是否可以通过地址栏在任一平台上执行 map 搜索,如果可以这样做的话:

private void btnSubmitAddress_Click(object sender, EventArgs e) {

    string stateSelected = this.cbState.Text; // Stores the selected State
    string citySelected = this.cbCity.Text; // Stores the selected City
    string addressSelected = this.cbPreDefAddress.Text; // Store the selected address

    string result = addressSelected + " " + citySelected + " " + stateSelected; // Creates a single address string.

    wbSatNavBrowser.Navigate("https://www.bing.com/maps/search?" + result);
}

最佳答案

Bing map 网站是一种消费产品,不应在业务应用程序中加载。相反,请考虑使用 Bing map 开发人员 API。 Bing Maps WPF 控件在 WinForms 内部工作,这里有一篇关于此的博客文章:https://rbrundritt.wordpress.com/2012/01/05/using-bing-maps-in-winforms/

您可以使用 REST 服务对位置进行地理编码。这是使用这些服务的一个很棒的 .NET 库:https://github.com/Microsoft/BingMapsRESTToolkit

如果您需要最多的 map 功能,您还可以在 Web 浏览器控件中托管 Bing map Web 控件。这是一个代码示例:https://code.msdn.microsoft.com/Using-the-Bing-Maps-V8-Web-07e21f3a?redir=0

关于c# - 从 utr 执行 Google/Bing map 搜索,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47550223/

相关文章:

google-maps - 谷歌静态 map 通过倾斜获得卫星 View

c# - 如何使用属性过滤 Xml 文件?

c# - 使用 linq 将列添加到当前 DataTable

c# - 直到按下 alt 键才显示模态通用对话框

c# - 如何在Windows应用程序C#上播放youtube视频

c# - 如何在 C#winform 中将列表项添加到 ListView?

android - 无法解析 : com. google.maps.android :android-maps-utils:0. 4+

angular - 如何将 Google map 与 Ionic 3 结合使用

c# - 如何覆盖 default(int?) 以获得 NULL 而不是 0

c# - 将 c#/selenium 转换为 python/selenium