At last nights Orange County ColdFusion Users Group meeting (occfug.org) I presented on the topic of integrating the Google Maps API into a ColdFusion application. I made a custom tag for the presentation that generates a Google API powered map, and I am posting it here for all the people that wanted access to the source code.

The cf_gMap custom tag is used to generate the map and you can add markers to the map by using the cf_gMapMarker tag. In the future I want to add the ability to specify custom icons for the markers but I have not had time for that yet. Also, this tag currently only works with ColdFusion 8 because I used the cfajaxonload function to initialize the map, but that can be easily modified if anyone wants it to work with older versions of ColdFusion. If you have any other suggestions for additional functionality that might be useful, please leave a comment below.

Comments (Comment Moderation is enabled. Your comment will not appear until approved.)
Jeff Gladnick's Gravatar Scott,

I have been contributing to a similar project started by John Blayter - Perhaps we should pool our resources...

http://www.blayter.com/john/cf_googlemap/
# Posted By Jeff Gladnick | 4/19/08 6:20 PM
Sebastiaan's Gravatar Maybe an idea to pool you resources AND create a RIAForge project for this? Or maybe even better, check out the other CF Google Maps API thingamajigz, pool all of them and create ONE tool. Would be nice for all of us CF-coders out there ;-)
# Posted By Sebastiaan | 4/23/08 5:15 AM
Scott Bennett's Gravatar @Jeff/Sebastian,

I don't have any time to work on this further right now, but I may do some more with it over the summer since it looks like people are pretty interested in it. I'm not sure if it is RIAForge worthy at this point, but once I have time to add a little more functionality to it, I may consider putting it up there.
# Posted By Scott Bennett | 5/27/08 6:01 PM
tony shelton's Gravatar so is there any chance that the google maps api can be integrated with cfform using the flash format? maybe using some flash remoting to update the map and cfgrid?
# Posted By tony shelton | 11/17/08 2:07 AM
Wolfram's Gravatar i am having a hard time to find any simple google checkout code in cold fusion.
do you know where i might find some?
# Posted By Wolfram | 1/16/09 8:21 PM
Scott Bennett's Gravatar Have you tired CheckoutCFC?

http://checkoutcfc.riaforge.org/

You can also read the tutorial by Scott Pinkston:

http://www.scottpinkston.org/blog/index.cfm/2007/2...

And if that doesn't help you might try commenting on his blog =). Unfotunately, I don't really have any experience with google checkout as of yet so I can't be much help.
# Posted By Scott Bennett | 1/17/09 1:24 AM
Chris Kellett's Gravatar Good work on this - it really got me out of a bind when using Google maps code in a cfwindow.

I have modified the tag somewhat so that it now has an optional attribute "FitAllPoints" which performs automatic scaling/zooming of the Google Map.

It will Scale/Zoom the map and auto-center the map based on the marker points that are used on the map. Very handy when you're displaying lots of different points.

You can download the tag here:
http://www.itsflying.com/customtags/gMap.zip

Once again thanks for the tag, and I hope this change is useful for you/others.

Cheers,

Chris
# Posted By Chris Kellett | 3/3/09 8:11 PM
Chris Ulrich's Gravatar Chris -

Great update to the tag. I've taken the liberty to add a few
more features to it -

- It now does markers or polylines or both
- In the "bubble" when you click on a marker it does the
reverse geo lookup, pulling up the street address
for coordinates
-- I have one glitch here, probably with variable scope
in javascript. If you have a suggestion, see:

http://www.experts-exchange.com/Programming/Langua...

- I want to add color choices & marker choices for the markers
and for the polyline

Once I get it working, I'll post a link to the revised tags

Thanks

Chris Ulrich
http://www.DirectResponseGroup.com
# Posted By Chris Ulrich | 3/28/09 10:56 AM
Steve's Gravatar Hi Scott, I just found your site searching for a coldfusion google maps custom tag. This tag sounds great, where can I find the latest version. Thanks so much.

Steve
# Posted By Steve | 5/28/09 12:03 AM
Rafi Akbar's Gravatar I have always used Google maps and I would like to know how to improve the directions on the layout, I am looking for a buddy for improve my skills. Street view is cool and I want to add this with a scallable size image too

Do leave a message on here

rafiul_akbar@hotmail.com
# Posted By Rafi Akbar | 11/24/09 8:19 AM
TM's Gravatar I tried your code and worked perfectly. I could not find an option for printing the map. I don't want to print the whole web page, just want to print the map only.
# Posted By TM | 9/16/10 4:02 PM
Scott Bennett's Gravatar @TM,

This functionality is not built into my tag, however a simple solution would be to have your print button open a new window that just displays the map and prints it.
# Posted By Scott Bennett | 9/16/10 4:14 PM
 
Home | Blog | Portfolio | Contact | © 2001 - 2007 The ColdFusion Guy - Scott Bennett. All rights reserved.
BlogCFC was created by Raymond Camden. This blog is running version 5.9.