solution1368
asked on
google map
var locations = new Array([34.01843,-118.49104 6,'90032', 'AgencyNam e1'],[34.0 06673,-118 .486562,'9 0032','Age ncyName2'] );
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
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
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
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
ASKER
can you show me in .cs? not a javascript programmer
ASKER
About the xml. I don't know how to parse out the location from the xml. do you know any codes I can use?
You can replace the 'XML' with 'json' in that url to get JSON response, if you prefer that.
https://developers.google. com/maps/d ocumentati on/geocodi ng/?csw=1# JSON
https://developers.google.
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;
}
ASKER
I don't get it. XDocument? Can you provide complete working codes? Thanks
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
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
ASKER
show me working codes example. don't refer me to url. everyone know how to google it.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
https://developers.google.
Here is a guide to using it:
https://developers.google.