使用文本框值在c#.net中显示谷歌地图 [英] show google map in c#.net using textbox value

查看:70
本文介绍了使用文本框值在c#.net中显示谷歌地图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





i希望在我的浏览器中使用c#.net显示地图名称在文本框中写入。



i want to display map in my browser using c#.net which area name is write in textbox.

推荐答案

使用以下链接获取您指定位置的地图



https://maps.google.com/maps?q=Hyderabad,+Andhra+Pradesh,+India&hl=en&sll=17.385044,78.486671&sspn=0.506527 ,0.615921& oq = Hyderabad& t = h& hnear = Hyderabad,+ Ranga + Reddy,+ Andhra + Pradesh,+ India& z = 11 [ ^ ]



所以n用文本框值准备一个这样的Url(例如Hyderabad,Andrapradesh,india是搜索字符串)。

在浏览器控件中渲染该URL



谢谢

--RA
Use the below link to get the maps for your given location

https://maps.google.com/maps?q=Hyderabad,+Andhra+Pradesh,+India&hl=en&sll=17.385044,78.486671&sspn=0.506527,0.615921&oq=Hyderabad&t=h&hnear=Hyderabad,+Ranga+Reddy,+Andhra+Pradesh,+India&z=11[^]

So now prepare a Url like this with textbox value(above example Hyderabad, Andrapradesh, india is the search string).
Render that URL in the Browser control

Thanks
--RA


我的解决方案很简单..



my solution is to simple..

var chicago = new google.maps.LatLng(22.258652//textbox1.value
                                                          ,71.192381//textbox2.value
   );
  var mapOptions = {
    zoom:6,
    mapTypeId: google.maps.MapTypeId.ROADMAP,
    center: chicago
  }
  map = new google.maps.Map(document.getElementById('map'), mapOptions);
  directionsDisplay.setMap(map);


这篇关于使用文本框值在c#.net中显示谷歌地图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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