Monday, November 9, 2009

Embed Google Map in your site using Coldfusion+Javascript or coldfusion9

If you are planing to add google map in your site and you are using coldfusion technology (what ever version it is), this blog is for you.

This will prove "Coldfusion make developer life easy".

Here i have given 2 approaches to embed google map in your site.

The first one is using coldufsion9 cfmap tag library
and the other one is using combination of javascript, coldfusion.
Please have a look into it and make suggestions to make it rich.

prerequisites:

1. Generate google map key:

Go to the site "Sign Up for the Google Maps API"
at http://code.google.com/apis/maps/signup.html
and provide the site for which you are registering at the filed
My web site URL:
and click on Generate API key
you will get the google map key which can be used in the following cfmap example.

2. Know the Longitude and Latitude of the site which you want to render.

centerlatitude="latitude in degrees"
centerlongitude="longitude in degrees"
or

You have to know the centeraddress(The address of the location, which is set as the center of the map)
centeraddress="address"

cfmap Example1:

<cfajaximport params="#{googlemapkey='ABQIAAAUCIwg8aLWw'}#" />
<cfset this.googlemapkey="ABQIApZi4-VoFLw">

<cfmap name="raghuMap
centeraddress="127.0.0.1"/>


cfmap Example2:
<cfmap name="raghugmap"
centerlatitude="16.33"
centerlongitude="76.05"
doubleclickzoom="true"
overview="true"
scrollwheelzoom="true"
showscale="true"
tip="Raghu Map"
zoomlevel="4"/>

with the above example i located rendered karnataka
in india map google map in my site.

Awesome tag right!!
Thanks Coldfusion.

The same functionality using coldfusion(older versions of cf9)+javascript version will be
be updated sooon....



Thank you friends...

Please share your suggestions and user experience when you use cfmap feature.

Happy coding!

http://raghuramcoldfusion.blogspot.com

Raghuram Reddy Gottimukkula

Adobe Certified Advance Coldfusion Developer,

Software Engineer,

Bangalore


Bangalore Current Time :