Blayter.com

cf_googleMap v.1.3 prerelease

I am working on wrapping up the 1.3 revision of cf_googleMap. There are a bunch of documentation changes and a few new features I have added. Some of the biggest changes for this project is releasing this on RIA Forge. As a sneak peak I have gone ahead and posted the pre-release 1.3 version on my site and RIA forge.

Comments
Hi John - I just downloaded the new RIAforge version tonight and I am quite impressed...that's a lot of little tidbits in one juicy bundle!

Based on your 'example 7' which allows a sliding point to select lat/long, I managed to weave a custom lat/long finder into my CFcms for a local travel info site - when entering a 'point of interest', the admin user can popup a map, slide the pointer to the location of the article subject, and the lat/long get saved to the db for use on the display side. This is gonna be sooo s w e e t.

However, one thing I have not seen in my adventures so far - is there any way to use cf_googleMap to show a point based on an address string alone? ( like the 'search the map' form on the google maps page itself )

I see you have a geocoder but as of yet don't quite see how to use that (I'm sure it's there somewhere but heck, it is almost 2am my time!)

Thanks for this great bit of code... looking forward to whatever else you can possibly find to keep adding to it!
# Posted By Michael Evangelista | 1/9/07 1:29 AM
Michael,

Your the second person today that has asked for that feature in the tag. While this is possible with the Google Maps API this has not yet been integrated into the tag. I will make sure to add this in the next build. However in the meantime there is a geo.cfc that contains a method for geocoding an address.

- John
# Posted By John Blayter | 1/9/07 8:15 AM
Hi John -
thanks for the follow up.
I took a look at the geo.cfc but didnt see much in the way of documentation. Any chance you can point me in the right direction, to an example of the 'call' to this cfc to turn an address into a set of coordinates?

Thanks SO much for this EXCELLENT piece of CF engineering. Truly impressive.
# Posted By Michael Evangelista | 1/9/07 9:16 AM
PS - I looked for it, but didnt see a 'donate' or 'wishlist' link... I'd love to send something your way if possible.
# Posted By Michael Evangelista | 1/9/07 9:17 AM
Please see the URL below for an example on how to use the geocoding method in the geo.cfc

http://www.blayter.com/john/cf_googlemap/exampleGe...
# Posted By John Blayter | 1/9/07 1:10 PM
oh ya and I posted my amazon wish list :)
# Posted By John Blayter | 1/9/07 1:17 PM
well heck I musta missed that example in the downloaded docs... thanks!
# Posted By Michael Evangelista | 1/9/07 9:25 PM
ok.. so that 'xample isn't in the default examples, is it?
The 'view source' on yours is just as good... thanks again.

Oh, and, I hope you still want the
Logitech 980356-0403 Stereo USB Headset 250
coming your way shortly...
# Posted By Michael Evangelista | 1/9/07 9:55 PM
No the example is not in the standard release yet. I just added it for you yesterday.

> Oh, and, I hope you still want the Logitech 980356-0403 Stereo USB Headset 250

Sweet, thanks!
# Posted By John Blayter | 1/10/07 8:25 AM
Hi John - back again.
I have spent quite a bit of time exploring the options in cf_googlemap, still very pleased and impressed but a few quick q's for you, if I may...

- when showing multiple points on a map, and some of those are very close together, is there any way to specify which one will be 'on top'? I have a business listing system in the works, and if an address is not specified, I am using the center of town. Thing is, I also have a general marker showing the center of town, which I would like to always be on top no matter what... possible?

- your geo example was very helpful - thanks again. However, the google encoder itself seems pretty finicky about what it can digest. I struggled for quite a while with the error 'Could not perform web service invocation "geocode_address". ' and finally got around it by using cftry/cfcatch, and a set of default coordinates with a js alert when the address returns errors from the encoder. Is there a better known way around this?

- also, is there any way to maximize the likelihood that google maps will recognize an address? Here in utah we have strange coordinate-based street addresses like "234 North 100 East"... it doesnt seem to like this very much at all, though some of them are working just fine. What seems strange is that some addresses that return errors in the geocoder still return succesful results when using the 'get directions' dialog on the map... I guess I assumed these 2 functions (geo encoder / get directions) would use the same rules... but apparently not... or am I missing something?

Thanks again for a great piece of work... really pleased.
# Posted By Michael Evangelista | 1/19/07 1:14 AM
sorry - not stalking you, promise, just uber-psyched about cf_googlemap.
One more quick q - have you done anything with the 'GoverViewMapControl()' function? http://www.econym.demon.co.uk/googlemaps/examples/... is one example... but the one I really like has the 'overview' control in the lower corner, imbedded into the main map. Not wanting to push my luck.. what you have given us right now is excellent to say the least... but I really like that little control box!
# Posted By Michael Evangelista | 1/19/07 9:23 AM
Michael,

I am currently buried under a stack of work and some remodeling at home. I should have some time this weekend to answer your questions. I just didn't want to leave you hanging.

Thanks

Jonh
# Posted By John Blayter | 1/19/07 11:14 AM
Q.) When showing multiple points on a map, and some of those are very close together, is there any way to specify which one will be 'on top'? I have a business listing system in the works, and if an address is not specified, I am using the center of town. Thing is, I also have a general marker showing the center of town, which I would like to always be on top no matter what... possible?

A.) I have not found a way per say to what icon takes precedence over another. Some things that you may want to try is by the pointName in the googleMapPoint tag having the city center point named something like “aaaaCityCenter”. It also might help if you pass the city center points into the tag last.

Q.) Your geo example was very helpful - thanks again. However, the google encoder itself seems pretty finicky about what it can digest. I struggled for quite a while with the error 'Could not perform web service invocation "geocode_address". ' and finally got around it by using cftry/cfcatch, and a set of default coordinates with a js alert when the address returns errors from the encoder. Is there a better known way around this?

A.) Download the 1.3 version of the tag. The geocode function inside of the geo.cfc is much better and should give you better results. You now pass in each part of the address as a argument and it does a try/catch removing parts of the address until it gets a geocode.

Q.) Also, is there any way to maximize the likelihood that google maps will recognize an address? Here in utah we have strange coordinate-based street addresses like "234 North 100 East"... it doesnt seem to like this very much at all, though some of them are working just fine. What seems strange is that some addresses that return errors in the geocoder still return succesful results when using the 'get directions' dialog on the map... I guess I assumed these 2 functions (geo encoder / get directions) would use the same rules... but apparently not... or am I missing something?

A.) The old geocoder function was based off of geocoder.us that was built off of public databases. The new function uses the Google geocoder. I am not really sure a better way if Google is not returning anything to you for the geocode. Have you tried changing the North to N and East to E in the address?

Q.) have you done anything with the 'GoverViewMapControl()' function?

A.) No I have not but I must say that is wicked cool. I will add that to the feature request list.
# Posted By John Blayter | 1/24/07 4:52 AM
thanks for the detailed answers...dl'ing new version now!
# Posted By Michael Evangelista | 1/24/07 7:44 AM
Back again - just to say T H A N K S for the update to the geo.cfc. It is definitely more accurate now, with many addresses that were previously un-encodable showing up just fine, even our funky Utah 'grid' address formats seem ok. Very nice!
# Posted By Michael Evangelista | 1/25/07 8:50 PM