Google Geocode CFC
So - I have a real cool client. This client had a request for code that would integrate with Google's Geocode API. This same client also had no problem with me making a nice CFC out of the code and sharing it with the world. This client wants to remain anonymous, but he has my thanks.
You can download the CFC here: http://googlegeocode.riaforge.org/.
I also created a simple demo.
Enjoy.
Oh - and if you were using RIAForge today and noticed some downtime - sorry. I've been trying to get a system update all week and I finally got it finished today. (Yes, I did a major system update at 3PM on a Friday and yes, I know how dumb that is.)
Comments
For any who see this and are unfamiliar with APIs like Google's, you will need to obtain a key from them before you can run this code locally. Ray's online demo must be using his (or his client's) key.
To get a new key, and indeed to learn more about the API, note the links on the top left of the page Ray points to.
I was impressed to see that one gets 50,000 requests per day. That's very generous. I see also that if you use this for a non-public site, then you are expected to get an enterprise license. Just trying to foresee some questions that others might have (and indeed that I had) on seeing this nifty demo.
Great stuff as always, Ray.
Ooooh Actually I have a thought right now.
Charlie: Dude - who needs docs? ;)
Entered: 33521 S. State Rt. F, Garden City, MO 64747
Error:
Element ADDRESSDETAILS.COUNTRY.ADMINISTRATIVEAREA.SUBADMINISTRATIVEAREA.LOCALITY.LOCALITYNAME.XMLTEXT is undefined in XMLRESULT
Thanks, I often have to geocode customers who have moved since the last USPS, MS Mappoint, and Marketing db updates. I have been using Google Earth for the task, but this is so much faster and lean than having to fire up Google Earth.
D.
Check it out:
http://www.blayter.com/john/cf_googlemap/
Competition is a good thing, and collaboration is a good thing.
Since John has posted his project on RIAForge as well, would you consider becoming a contributor to his project? I think it would legitimize the need for a GoogleMaps cfcomponent and add a developer to your team.
The returned address was on East Losey Street
Using the google maps interface (in times past) I've been asked for clarification between east and west Losey...Today when I checked, it took me right to W Losey.
hmmm...
"Element ADDRESSDETAILS.COUNTRY.ADMINISTRATIVEAREA.SUBADMINISTRATIVEAREA.LOCALITY.THOROUGHFARE.THOROUGHFARENAME.XMLTEXT is undefined in XMLRESULT."
rue des mésanges bleues, belgium
You setup the the function to recursively call itself, and use a weaker attempt at an address each time. For example
1st call: Street1 Street2 City State Zip, State, Country
if fail
2nd call:Street1 City State Zip, State, Country
if fail
3rd call:Street1 City State Zip, Country
if fail:
4th call: Street1 City State, Country
if fail:
5th call: Street1 City State, Country
etc, etc, etc
Thats how it works in cf_googlemap. Ray, i fully encourage you to help out with cf_googlemap (if you have time, you are already carrying a lot of weight as it is)
"27882 Via Del Agua, Laguna Niguel, CA 92677"
I get "Element ADDRESSDETAILS.COUNTRY.ADMINISTRATIVEAREA.SUBADMINISTRATIVEAREA.LOCALITY.LOCALITYNAME.XMLTEXT is undefined in XMLRESULT."
I'm running this on CF7 and not sure what would cause this since if I go to the demo at http://ray.camdenfamily.com/demos/googlegeocode/te... it works and if I go to http://maps.google.com it works as well.
Any help is much appreciated!
Thanks,
Randy
Could you provide us with some code samples for this project that will work with GoDaddy hosting(createObject disabled)?
Thanks,
Greg


Yea it's not as pretty as your but hey I'm trying.
Keep up the good work.