I’m looking to create a web application that starts to suggest home addresses as you type. For instance, imagine a pizza delivery company, where you start typing in your address, "1279", and beneath the box it brings up 1279’s in the US for people to choose from, like:
1279 Main Street, St. Louis, MO
1279 Tree Street, Baltimore, MD
In this way, it would really mirror maps.google.com in bringing up suggestions as you type.
I’ve looked through the Google Places and Maps APIs without much success. The GeoCoding one works OK by passing an address parameter through, but often returns no results or really bad ones… nothing like maps.google.com. Plus they’re difficult to parse. (The address parts parameters aren’t always consistent, meaning that I have to send the formatted address through another parser… not a deal-breaker though.)
Anyone else have any suggestions out there? Thanks! Jeremy
You can improve the Places autocomplete results by passing
boundsoption when creating it. The example binds it to the map viewport:In this demo I hardcoded the continental US bounds (plus some of Mexico and Canada)