使用C#在winforms中映射

问题描述:

你好



我想知道是否有人可以提供帮助?我有一个winform申请地点。我想在表格中添加一个谷歌地图,如果我按下地图上的任何地方,纬度和经度应该显示在一个文本框中。

hello

i wonder if anyone can help? i have a winform application for locations. I want to add a google map to the form, and if i press anywhere on the map the latitude and longitude should show in a text box.

你需要将某些描述的网页控件放入您的应用程序以显示谷歌地图 - Google API已经有很多关于如何使用它的示例,因此我建议您首先开发显示给定一组的地图的网页地点。



我是通过使用guid作为id将所需位置写入数据库表来实现的,然后将Guid传递给显示地图的ASPX页面有位置。



将数据传回窗口表格证明不那么重要,我最终使用网页表单进行地图集成 - 但仍然在我的网页内托管windows app。
You will need to put a web control of some description into your app to display a google map - the Google API is well documented with many many examples of how to use it, so I suggest you start by developing your web page that displays the map given a set of locations.

I did it by writing the required locations to a DB table using a guid as the id, then passed the Guid to an ASPX page which showed the map with locations.

Passing the data back to the windows form proved less trivial, and I ended up using a web form for map integration - but still hosting the page inside my windows app.


查看 http://greatmaps.codeplex.com/


可以使用GDS Google轻松完成映射WinForms控件。只需将控件添加到WinForm应用程序,然后响应MapMouse事件。
It can be easily done by using GDS Google Map WinForms Control. Just add the control to your WinForm application, then response to the MapMouse events.