从c#.net控制台应用程序中获取纬度和经度的位置详细信息 [英] Get location details from latitude and longitude in c#.net console application

查看:74
本文介绍了从c#.net控制台应用程序中获取纬度和经度的位置详细信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

HI全部,

我正在尝试加入google api以获取位置详细信息,我发现以下google api获取位置详细信息。

http://maps.googleapis .com / maps / api / geocode / json?latlng = 17.49266,78.54620& sensor = true [ ^ ]



如何使用此网址c#4.0申请获取位置详情?



提前感谢您的建议..



- Avinash

HI All,
I am trying to acceess google api to get location details, I found following google api to get the location details.
http://maps.googleapis.com/maps/api/geocode/json?latlng=17.49266,78.54620&sensor=true[^]

How to use this url in c# 4.0 application to get location details?

Thanks in advance for your suggestions..

--Avinash

推荐答案

简单的方法是从谷歌API获取您的位置数据是使用AJAX调用。



Simple method is to Get your location data from google API is to use AJAX call.


.ajax({
dataType:json,
url:http://maps.googleapis.com/maps /api/geocode/json?latlng=17.49266,78.54620&sensor=true,

成功:function(){
// TODO:获取json对象并将其作为变量对齐
}

});
.ajax({ dataType: "json", url: "http://maps.googleapis.com/maps/api/geocode/json?latlng=17.49266,78.54620&sensor=true", success: function(){ //TODO : get json object and asign it in your variables } });



成功函数将返回JSON对象。用它来获取你的位置。



如果你想发送数据然后用


the success function will return the JSON object. use this to get your location.

if you want to send data then use

data:{}

发送JSON对象作为参数。



如果你想处理错误然后使用



to send JSON object as parameter.

if you want to handle error then use

error: function(){
      //TODO : Handle error
   }





我可以帮到你..



I thing this may help you..


检查这个Stackoverflow链接



http://stackoverflow.com/questions/2246694/how-to-convert-json-object-to-custom-c-sharp-object



这会对你有帮助..
Check this Stackoverflow link

http://stackoverflow.com/questions/2246694/how-to-convert-json-object-to-custom-c-sharp-object

This will help you..


这篇关于从c#.net控制台应用程序中获取纬度和经度的位置详细信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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