在Winforms中使用Google Map API [英] working with google map API in winforms

查看:93
本文介绍了在Winforms中使用Google Map API的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好

我想做一个Windows应用程序,在其中我在textBoxes中输入r的纬度经度.我有一个webbrouser工具可以在我的应用程序上显示它.我在互联网上看到它们都对Web应用程序提供了建议,但我需要使用C#在Windows应用程序中实现.因此,任何人都可以向我建议一些代码或链接.


谢谢你提前
Arun

hello guys

I want to do a windows application where i enter the latitude longitude that r in textBoxes . I m having a webbrouser tool to display it on my application . I saw in internet they all give suggestions on web application but i need to implement in on windows application using C# . So can any body suggest me some code or link.


Thanks with advance
Arun

推荐答案

我相信您可以在此处找到一些示例^ ].
I believe you may find some examples here here[^].


您可以查看它"Google代码游乐场" [^ ]

当您使用Google API时,这可能是您的最佳选择.

您可以从左侧面板选择API"中找到它.

您也可以找到其他一些api(如果需要).

抱歉,它不适用于Windows应用程序.
You can have a look at it "Google Code Playground"[^]

As you are using google api, that may be the best option for you.

You can find it from your lefthand panel "Pick an API".

You can find some other api(s) too (if required).

Sorry it is not for Windows application.


在您的表单中添加两个文本框和一个按钮,供网络浏览器导航.在按钮单击事件上,请执行以下操作:
Add two textboxes and a button to your form to which the webbrowser will navigate. On button click event, do this:
private void button1_Click(object sender, EventArgs e)
{
    webBrowser1.Navigate("http://maps.googleapis.com/maps/api/staticmap?center=" + textBox1.Text + "," + textBox2.Text+"&zoom=14&size=400x400&sensor=false");
}


例如.在textbox1中,键入51,在textbox2中,键入0(即零),然后按按钮导航到该位置.该示例将显示伦敦地图.地图中的缩放级别也可以根据您的选择进行更改.

上面的示例将显示静态地图,但是希望您得到了想要的东西. :)


Eg. In textbox1 type 51, in textbox2 type 0 (i.e zero), and then press the button to navigate to that location. The example will show London map. The zoom level in the map can also be changed according to your choice.

The above example will show static maps, but I hope you got what you wanted. :)


这篇关于在Winforms中使用Google Map API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆