PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
So basically, I want to incorporate google maps into my website. However, I need the longitude and latitude for the locations. The content is apartment and house locations, and they are stored in a database of street addresses, city, [MA], and zip code. Is there anyway to get the dimensions based on the street address? Maybe through google somehow? Thanks.
Basically, best case scenario, I have the user input their work address and a google map displays the closest apartments to the inputted address.
hmmmm... well, you could do some caching... use a quasi learning routine that can get a "close enough" match quickly. XMLHTTP may help smooth it out too... especially if you are using a "close enough" match, set the zoom out a ways, use XMLHTTP to get the exact coords and zoom in It's a feature!
Feyd, you never cease to make me feel like a n00b.... thank you for it.
I don't understand however what you mean by a quasi-method.... I'm making this site for specifically the boston area, should I make a db with all the coors for the boston area by zip code and then use that?
you could definitely start with a zip code, if they provided that. Since those coords are fairly known. Then, if you don't have the actual coords already, use the XMLHTTP idea. I'd log the addresses queried for.. and nightly or hourly batch out and cache the coords.. after a while you'll start to get pools, you can use that data to create the best guess... it can use a good deal of logic code, as you basically have to guess "Is this address near these others I've already collected?"