http://maps.google.com/maps/api/geocode/json?address=londrina,pr&sensor=false
I have a list of 150 cities, and would like to get the latitude and
longitude of them all. There is an automatic way of doing this, not
having to type each one in the url?
Then I'll enter these values in the marker with the Google Maps API.
var marker = new google.maps.Marker({
position: myLatlng,
map: map,
title:"Uluru (Ayers Rock)"
});
For now, I'm using the function insert below, to automatically
convert, but is not carrying all the markers. Carries only about 30
markers and I think the problem is due to conversion to latitude /
longitude in the script.
What do you think?
FUNCTION CODE
function addAddressToMap(response) {
if (!response || response.Status.code != 200) {
//alert("Sorry, we were unable to geocode that address");
} else {
place = response.Placemark[0];
point = new GLatLng(place.Point.coordinates[1],
place.Point.coordinates[0]);
var marker = new GMarker(point);
GEvent.addListener(marker, "click", function() {
html = document.getElementById("map_canvas").value;
marker.openInfoWindowHtml(html + place.address + '<br>')
});
map.addOverlay(marker);
}
}