在C#ASP> NET中进行地址解析 [英] Geocoding in C# ASP>NET

查看:46
本文介绍了在C#ASP> NET中进行地址解析的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我有一个网站,我想根据该网站在文本框中输入的地址来显示Google地图.我尝试使用所示的地理编码示例(在C#中),但是它没有地方将地址作为输入来根据地址显示位置.请帮助我.

Hi,

I have a website where in I want to display the Google map according to the address entered in the textbox. I tried to use the geo coding example shown(in C#) but it nowhere takes the address as input to display the location according to the address. Please help me.

推荐答案

您需要执行的所有操作都在文档中

https://developers.google.com/maps/documentation/geocoding/ [ http://maps. googleapis.com/maps/api/geocode/json?address=1600+Amphitheatre+Parkway,+Mountain+View,+CA&sensor=false [ https://developers.google.com/maps/articles/geocodestrat [
Everything you need to do this is in the documentation

https://developers.google.com/maps/documentation/geocoding/[^]

Make a request to Googles service and receive the request back in the format you want, either XML or JSON

e.g. click this link, it''s doing what you need to do

http://maps.googleapis.com/maps/api/geocode/json?address=1600+Amphitheatre+Parkway,+Mountain+View,+CA&sensor=false[^]

That can be a standard HTTP request in c#, which you can just deserialize and retrieve the geometry->location->lng/lat values. Or, you can make a request directly from script. (Client-side geocoding)

https://developers.google.com/maps/articles/geocodestrat[^]

Once you have them, just plot the coorindates onto a map and it will display!


这篇关于在C#ASP> NET中进行地址解析的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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