迈克·威廉姆斯的教程中没有出现这两行:
wait = true; setTimeout("wait = true", 2000);这是第3版端口:
http://acleach.me.uk/gmaps/v3/plotaddresses.htm
相关的代码位是
// ====== Geocoding ====== function getAddress(search, next) { geo.geopre({address:search}, function (results,status) { // If that was successful if (status == google.maps.GeoprerStatus.OK) { // Lets assume that the first marker is the one we want var p = results[0].geometry.location; var lat=p.lat(); var lng=p.lng(); // Output the data var msg = 'address="' + search + '" lat=' +lat+ ' lng=' +lng+ '(delay='+delay+'ms)<br>'; document.getElementById("messages").innerHTML += msg; // Create a marker createMarker(search,lat,lng); } // ====== Depre the error status ====== else { // === if we were sending the requests to fast, try this one again and increase the delay if (status == google.maps.GeoprerStatus.OVER_QUERY_LIMIT) { nextAddress--; delay++; } else { var reason="Code "+status; var msg = 'address="' + search + '" error=' +reason+ '(delay='+delay+'ms)<br>'; document.getElementById("messages").innerHTML += msg; }} next(); } ); }


