While this is not exactly your problem, your subject line talks about non-existent addresses.
There may be a house located on 123 Main Street, and right next door is 127 Main Street. If you attempt to geoCode 125 Main Street, the Service will return a result (if you're lucky, it will be labelled "Range Interpolated," but you can't even count on that 100% of the time). Even though there is no house there. So if you're trying to determine whether you can deliver a Pizza to 125 Main street, this isn't perfect. The USPS has an address verification service. It will tell you that 125 Main street probably is no good (for purposes of mail delivery, and who should know better?) But it might also tell you that 123 Main Street is no good (because they receive their mail on the cross street at 201 Elm St.) Here, it might be safe to deliver a Pizza to 123 Main Street (they have a door there) even though it is not their mailing address. GeoCoding requires a lot of thinking. - Jeff On Dec 6, 2:27 pm, waldo22 <[email protected]> wrote: > I am trying to geocode addresses to determine whether or not they are in > our delivery area for our service. > > For most addresses, it is working just fine; It either informs the > customer that they are outside of our delivery area, or it sets their zone > and allows them to continue. > > *However*, sometime in the last 6 weeks the API stopped working and no > longer returns ZERO_RESULTS for non-existent addresses as described > here:http://code.google.com/apis/maps/documentation/javascript/services.ht... > > If I use an address such as 123 Nowhere St. or 34 Gobbledygook Ln. or 44 > Bullhockey Rd., I get a status of "OK" and a LatLng object with the > coordinates of the city center. > > This means that anyone can type in *any* *fake* address and be treated as > if they were inside our area. > > For example, 123 Nowhere St. Durham, NC returns (35.9940329, -78.898619) > which is the same result as typing "Durham, NC" into maps.google.com. > > Here is a link to the page displaying this > behavior:https://www.scratchtakeout.com/cgi-bin/geocodeTest.pl > > (note: I have it set to alert(status + ' ' + > google.maps.GeocoderStatus.OK) for debugging - both always show up as "OK") > > Here is my full code: > > var geocoder; //this is global > > > > > > > > > > > function initialize() { > > geocoder = new google.maps.Geocoder(); > > } > > > function loadScript() { > > var mapScript = document.createElement('script'); > > mapScript.type = 'text/javascript'; > > mapScript.src = > > 'http://maps.googleapis.com/maps/api/js?sensor=false&callback=initiali... > > document.body.appendChild(mapScript); > > } > > function codeAddress() { > > var address = document.getElementById('streetAddress').value; > > var city = document.getElementById('city').value; > > var state = document.getElementById('state').value; > > > if (address === '') { > > alert('You must enter a street address!'); > > return false; > > } > > > address = address + ' ' + city + ' ' + state; > > > geocoder.geocode( { 'address': address}, function(results, status) > > { > > if (status == google.maps.GeocoderStatus.OK) { > > alert(status + ' ' + google.maps.GeocoderStatus.OK); > > //whichZone(results[0].geometry.location); > > return true; > > } else { > > showLightbox(320,130,'10px','notFoundChoice'); > > document.getElementById('tryAgain').focus(); > > return false; > > } > > }); > > } > > Does anyone know why the JS V3 API would return a status of "OK" even for a > non-existent address? > > It certainly used to work - and I haven't changed anything that I can > remember. > > Any help is appreciated! > > -Wes -- 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 [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-maps-js-api-v3?hl=en.
