[ 03 November 2005 ]

Google Maps and ColdFusion Integration

For one of my applications, I needed a way to display a list of addresses on a map. After some quick Googling, I was surprised to discover that there was no pre-built ColdFusion custom tag or CFC to handle this. So I whipped up my own.

The CFC is simple to use, and I've made it available for download. You will need your own Google Maps API key, which is free, and you'll need to plug that into the CFC source.

The CFC takes a couple of parameters, including map width, height, and starting zoom level. You then pass an array containing the address you want mapped, and the component does the rest. The initial map center is placed at the mean of the address array's latitudes and longitudes, so it should be somewhat near the center of your addresses. I may modify it later to set the starting zoom level based on the number of mapped points and their distance apart, but for now that's set when you call the component.

This code is freeware, feel free to use it as you see fit, leave me a comment if you like it.

Download

0 Comments:

Post a Comment

<< Home