Click here to Skip to main content
15,887,267 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
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
Posted
Updated 15-Nov-13 16:31pm
v2
Comments
Bernhard Hiller 18-Nov-13 4:06am    
Though my article http://www.codeproject.com/Articles/233698/Consuming-a-Json-WebService-from-a-Csharp-or-VB-Ap does not describe your example, you might learn the concept there.

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",
  
  success: function(){
       //TODO : get json object and asign it in your variables
    }

});

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

if you want to send data then use
data:{}
to send JSON object as parameter.

if you want to handle error then use

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


I thing this may help you..
 
Share this answer
 
Comments
Avinash6474 14-Nov-13 22:38pm    
Thanks for your response.
I am aware about this method to get location details, but I want to do it from c#.net console application. In .net how to use Google API to get location details by passing latitude and longitude?
GopalakrishnanPS 18-Nov-13 5:05am    
Check this Ans
http://www.codeproject.com/Answers/683930/Get-location-details-from-latitude-and-longitude-i#answer2
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900