从 utr 执行 Google/Bing 地图搜索
Perform a Google/Bing Maps search from a utr
我正在从事模拟(找不到更好的词)GPS 的项目。用户可以 select 一个州、城市和地址,例如 000 someadress.dr,我已经设置好,以便在单击提交按钮时,所有这些组件都组合成一个字符串。我想知道是否可以通过地址栏在任一平台上执行地图搜索,是否可以这样做:
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);
}
docs 显示了一些如何传递参数的示例。
This example sets the centerpoint of the map.
http://bing.com/maps/default.aspx?cp=47.677797~-122.122013
To open Bing Maps to a specific address:
Bing 地图网站是一种消费产品,不应在商业应用程序中加载。相反,请考虑使用 Bing 地图开发人员 API 的。 Bing Maps WPF 控件在 WinForms 内部工作,这里是关于此的博客 post:https://rbrundritt.wordpress.com/2012/01/05/using-bing-maps-in-winforms/
您可以使用 REST 服务对位置进行地理编码。这是使用这些服务的一个很棒的 .NET 库:https://github.com/Microsoft/BingMapsRESTToolkit
如果您需要最多的地图功能,您还可以在网络浏览器控件中托管 Bing 地图网络控件。这是一个代码示例:https://code.msdn.microsoft.com/Using-the-Bing-Maps-V8-Web-07e21f3a?redir=0
我正在从事模拟(找不到更好的词)GPS 的项目。用户可以 select 一个州、城市和地址,例如 000 someadress.dr,我已经设置好,以便在单击提交按钮时,所有这些组件都组合成一个字符串。我想知道是否可以通过地址栏在任一平台上执行地图搜索,是否可以这样做:
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);
}
docs 显示了一些如何传递参数的示例。
This example sets the centerpoint of the map.
http://bing.com/maps/default.aspx?cp=47.677797~-122.122013
To open Bing Maps to a specific address:
Bing 地图网站是一种消费产品,不应在商业应用程序中加载。相反,请考虑使用 Bing 地图开发人员 API 的。 Bing Maps WPF 控件在 WinForms 内部工作,这里是关于此的博客 post:https://rbrundritt.wordpress.com/2012/01/05/using-bing-maps-in-winforms/
您可以使用 REST 服务对位置进行地理编码。这是使用这些服务的一个很棒的 .NET 库:https://github.com/Microsoft/BingMapsRESTToolkit
如果您需要最多的地图功能,您还可以在网络浏览器控件中托管 Bing 地图网络控件。这是一个代码示例:https://code.msdn.microsoft.com/Using-the-Bing-Maps-V8-Web-07e21f3a?redir=0