使用Windows窗体应用程序映射

我正在构建一个需要地图的C#/ Winforms应用程序(谷歌地图,Bing地图等)。 但我对ToU(许可证) – 非商业用途等非常困惑。

我的问题:

  1. 为了商业目的,您会建议(最好是免费)使用winforms应用程序的映射提供程序。

  2. 如果应用程序处于“离线”状态,即无法从映射服务器获取切片,您会建议使用哪种映射提供程序。

  3. 谷歌地球看起来很有希望,直到我阅读ToU中的非商业用途条款,您是否知道通过购买许可证是否可以豁免? 任何商业替代品?

  1. 对于Windows应用程序,尝试使用浏览器控件查找OpenStreetMap以进行Windows窗体集成

  2. 对于离线解决方案,您需要地图数据。 最常用的地图数据格式之一是Shapefiles,它是ESRI标准,您可以下载OpenStreetMap数据并将其转换为Shapefile,然后您可以在应用程序中导入它们。 有一些开源项目正在使用Shapefiles进行地图渲染和其他GISfunction。 即SharpMap和DotSpatial (两者都是.Net实现)

  3. 您可以搜索Google地球专业版,也可以尝试NASA的World Wind(免费)

这非常好,您可以检查不同的提供商并选择符合法律和技术要求的提供商: 适用于Windows表单和演示文稿的出色地图

只需下载代码并查看演示!

尝试此代码使用Web浏览器控制此代码以获取两个位置之间的方向

System.Text.StringBuilder queryaddress = new System.Text.StringBuilder(); string sStreet = string.Empty; string sCity = string.Empty; string sState = string.Empty; string sPincode = string.Empty; string sProvider_no = string.Empty; queryaddress.Append("https://www.google.com/maps/dir/"); if (!string.IsNullOrEmpty(txtprovider_no.Text)) { sProvider_no = txtprovider_no.Text.Replace(" ", "+"); queryaddress.Append(sProvider_no + "," + "+"); } if (!string.IsNullOrEmpty(txtState.Text)) { sState = txtState.Text.Replace(" ", "+"); queryaddress.Append(sState + "," + "+"); } if (!string.IsNullOrEmpty(txtCity.Text)) { sCity = txtCity.Text.Replace(" ", "+"); queryaddress.Append(sCity + "," + "+"); } if (!string.IsNullOrEmpty(txtPincode.Text)) { sPincode = txtPincode.Text.Replace(" ", "+"); queryaddress.Append(sPincode); } queryaddress.Append("/"); sStreet = string.Empty; sCity = string.Empty; sState = string.Empty; sPincode = string.Empty; if (!string.IsNullOrEmpty(txtlindmark.Text)) { sStreet = txtlindmark.Text.Replace(" ", "+"); queryaddress.Append(sStreet + "," + "+"); } if (!string.IsNullOrEmpty(txtclient_city.Text)) { sCity = txtclient_city.Text.Replace(" ", "+"); queryaddress.Append(sCity + "," + "+"); } if (!string.IsNullOrEmpty(ttxtclient_city.Text)) { sPincode = ttxtclient_city.Text.Replace(" ", "+"); queryaddress.Append(sPincode); } if (!string.IsNullOrEmpty(txtclient_state.Text)) { sState = txtclient_state.Text.Replace(" ", "+"); queryaddress.Append(sState + "," + "+"); } WBR.Navigate(queryaddress.ToString());