Information at http://www.geospatialtrain
http://maps.google.com/map
So maybe my question should be "what's the easiest way to parse the returned xml and retrieve latitude and longitude?"
Main Topics
Browse All TopicsI want return latitude and longitude geocodes from Google Maps api from an address string and cache these in a MySql table, co-ords will be used for loading a map at the location of the address. There are examples on the net for loading a Google map using an address, but this is without caching:
var map = new GMap2(document.getElementB
var geocoder = new GClientGeocoder();
function showAddress(address) {
geocoder.getLatLng(
address,
function(point) {
if (!point) {
alert(address + " not found");
} else {
map.setCenter(point, 13);
var marker = new GMarker(point);
map.addOverlay(marker);
marker.openInfoWindowHtml(
}
}
);
}
I've also seen where a request can be sent with a url server side and it returns xml. Maybe that would work best for me using php, but I would have to parse the xml. All I want is 2 values, latitude and longitude so I can store these in a database table which would act as a cache. I would retrieve these values from the database for the same search to save time and number of calls to the Google server.
What format does the 'point' returned from getLatLng take? Can that be saved as is?
Any ideas please?
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Information at http://www.geospatialtrain
http://maps.google.com/map
So maybe my question should be "what's the easiest way to parse the returned xml and retrieve latitude and longitude?"
var xmlhttp;
var xmlResults;
/*@cc_on @*/
/*@if (@_jscript_version >= 5)
try{
xmlhttp=new ActiveXObject("Msxml2.XMLH
}catch(e){
try{
xmlhttp=new ActiveXObject("Microsoft.X
}catch(E){
xmlhttp=false;
}
}
@else
xmlhttp=false
@end @*/
if(!xmlhttp && typeof XMLHttpRequest!='undefined
try{
xmlhttp = new XMLHttpRequest();
}catch(e){
xmlhttp=false;
}
}
if(!xmlhttp && window.createRequest){
try{
xmlhttp = window.createRequest();
}catch(e){
xmlhttp=false;
}
}
xmlhttp.open('POST','/path
xmlhttp.setRequestHeader("
xmlhttp.send('googlevariab
xmlResults = xmlhttp.responseText;
Basically what is going on is that you send the returned google variables to a string like 'google='50.123456,-1.1234
Business Accounts
Answer for Membership
by: ncwPosted on 2007-10-06 at 08:20:02ID: 20027746
Just tested returning 'point' and I see it is in the format of eg (50.123456,-1.123456), but this is returned clientside in javascript so there's no way of inserting in the database. I need something similar serverside without having to parse xml unless there's an easy way to do the parsing.