google map

var locations = new Array([34.01843,-118.491046,'90032','AgencyName1'],[34.006673,-118.486562,'90032','AgencyName2']);

I have above code from google map. 34.01843,-118.491046 i guess it is what google need.
my question is

1. assume I have web form to allow user to enter name and address. and I need to convert
the address into 34.01843,-118.491046 and save into the database.

Where can I find the function to convert it?

2. If I already have database with address information, how can i convert it?

thanks
solution1368Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

GaryCommented:
Are you familiar with XML? Do you want to do this at the server or at the browser?

You can make a direct request to Google and it will return an XML response with the data.
http://maps.google.com/maps/api/geocode/xml?address=your-address&sensor=false

You can then just parse out the coordinates
0
solution1368Author Commented:
can you show me in .cs? not a javascript programmer
0
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

solution1368Author Commented:
About the xml. I don't know how to parse out the location from the xml. do you know any codes I can use?
0
shishir_sriCommented:
You can replace the 'XML' with 'json' in that url to get JSON response, if you prefer that.

https://developers.google.com/maps/documentation/geocoding/?csw=1#JSON
0
GaryCommented:
Try this
string url = "http://maps.google.com/maps/api/geocode/xml?address=london&sensor=false";
XDocument doc = XDocument.Load(url);

foreach (XElement element in doc.Element("GeocodeResponse").Element.("result").Element("geometry").Element("location").Descendants())
{
    string value = element.Value;
}

Open in new window

0
solution1368Author Commented:
I don't get it. XDocument? Can you provide complete working codes? Thanks
0
GaryCommented:
Did you try the code, you are using C#?
There is a tutorial here - have a read through and report back if you are uncertain about anything.
http://www.dotnetcurry.com/ShowArticle.aspx?ID=564
0
solution1368Author Commented:
show me working codes example. don't refer me to url. everyone know how to google it.
0
GaryCommented:
I provided you a sample, you said you don't get it - it doesn't get much simpler than that.
If you don't get it then you need to read up on it.
I'm not here to do all the work for you.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
HTML

From novice to tech pro — start learning today.