Convert Google Maps Locations that are displaying to XML Format as Output

Posted by Chakrip under ASP.NET on 10/29/2013 | Points: 10 | Views : 951 | Status : [Member] | Replies : 4
Hi,

I am doing a web application in Asp.Net, to retrieve Near By Places.

For getting this, i am using the below link,

https://maps.google.com/?q=area&near=ameerpet&radius=1

From the above link i am getting the places with in 5 kms having the output in the form of displaying locations in Google Maps.

But i want to give the above link as input and i need to get my output as in the form of XML format by using C# Coding or Javascript in ASP.Net.

Ex:

<Address>

<Area>

Keshavanagar Colony, Srinagar Colony Rd, Yousufguda, AP, India ?

</Area>

</Address>

<Address>

<Area>

MCH Park Area, Padala Ramareddy Colony, Yousufguda, Hyderabad, AP, India
</Area>

</Address>

<Address>

<Area>

Athithi Inn, Dharam Karan Rd, Divyashakti Appartments, Ameerpet, Hyderabad, AP 500016, India

</Area>

</Address>

<Address>

<Area>

GreenPark-Hyderabad, 7-1-26, Ameerpet Road,Begumpet,Hyderabad, Andhra Pradesh 500016, India ?

</Area>

</Address>

and soon......



Can any one please help me how to convert google maps to XML format by using C# Coding or Javascript in ASP.Net.

Thanks in Advance




Responses

Posted by: Bandi on: 10/29/2013 [Member] [MVP] Platinum | Points: 25

Up
0
Down
Refer the following link
http://deepak-sharma.net/tag/xml-google-geocoding-api/
http://www.codeproject.com/Articles/291499/Google-Maps-API-V3-for-ASP-NET

Mark This Response as Answer
--
Chandu
http://www.dotnetfunda.com/images/dnfmvp.gif

Chakrip, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Chakrip on: 10/30/2013 [Member] Starter | Points: 25

Up
0
Down
Hi Bandi, Thank you for your reply,

Upon searching in different Forums i found the below link.

https://maps.google.com/?q=area&output=json&near=ameerpet&radius=1

By using this link i am getting my output as JSON file.

But i don't want to download that file. Just i want to make a call to that link from my C# Code and i need to seperate my address block from that and i need to display that in my ASP Listbox or grid View Control.

By using that link i have tried converting JSON data to string or an array variable with C# code. My Code is like as,



var address = String.Format("https://maps.google.com/?q=area&output=json&near=ameerpet&radius=1");

var result = new System.Net.WebClient().DownloadString(address);

JavaScriptSerializer jss = new JavaScriptSerializer();

Object a = jss.DeserializeObject(result);



I am getting my result JSON data in "result" variable. But at the time of deserialization, i am getting an error.

I was struct at this area.

Can any one please help me by providing code to convert a JSON data to a string or an array format using C# Coding. As i need to display that data in ASP Listbox.

Thanks in Advance.

Chakrip, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Bandi on: 10/30/2013 [Member] [MVP] Platinum | Points: 25

Up
0
Down
Refer
http://www.codeproject.com/Questions/590838/convertplusJSONplusstringplustoplusdatatable
http://stackoverflow.com/questions/14792755/convert-json-string-to-c-sharp-string-array

Mark This Response as Answer
--
Chandu
http://www.dotnetfunda.com/images/dnfmvp.gif

Chakrip, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Bandi on: 10/30/2013 [Member] [MVP] Platinum | Points: 25

Up
0
Down
Refer the following link for "Populate an ASP.NET ListBox from JSON results using jQuery "
http://www.dotnetcurry.com/ShowArticle.aspx?ID=454

Mark This Response as Answer
--
Chandu
http://www.dotnetfunda.com/images/dnfmvp.gif

Chakrip, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response