We want to set the json return array to a variable so we can parse the
map data we need to then build the cost to make a map.
Ideas?
- Ron
Thank you for your kind answer and patience with my ignorance of the
finer aspects of Javascript!
I have spent several hours trying to work this out and am getting
nowhere. I have a time-sensitive project, so I need to ask for more help.
Why doesn't the following work? Is it necessary to specify another page
for the return json, or can a script on the same page process it?
Thanks!!!
- Ron
<!DOCTYPE html>
<html>
<head>
<style>img{ height: 100px; float: left; }</style>
<script src="http://code.jquery.com/jquery-latest.min.js"></script>
<script>
$(document).ready(function() {
$.getJSON("http://maps.google.com/maps/api/geocode/json?address=201+W+Capitol+Ave,+Jefferson+City,+MO,+651011&sensor=false",
function(data) {
parseMarkerList(data); //data = JSON returned
alert(data);
});
});
</script>
<script>
function parseMarkerList(data) {
for (var i=0; i < data.length; i++) {
var lat = data[i].Latitude; // Where Latitude is the node name
var lng = data[i].Longitude; // Where Longitude is the node name
//createMarker(lat, lng);
}
}
</script>
</head>
<body>
<script>
alert("Lat: " + lat +"Lng: " + lng);
</script>
</body>
</html>
--
*************************************
Ron Calzone
Director, Missouri First, Inc.
mailto:r...@mofirst.org
Web URL http://www.mofirst.org
*************************************
--
You received this message because you are subscribed to the Google Groups "Google Maps JavaScript API v3" group.
To post to this group, send email to google-map...@googlegroups.com.
To unsubscribe from this group, send email to google-maps-js-a...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-maps-js-api-v3?hl=en.
What's more, if you copy this to your browser and run it, it will return
json. My only problem is doing all of that in PHP or JS so I can
capture the json to a variable and parse out the lat-lgn.
I would be glad to use any other geocode system, though, if any can
suggest one.....
Thanks!
- Ron