Integrate Google Maps into Drupal

Update (2007-05-21): Use gmap module instead.

Here is an easy way to integrate Google Maps into Drupal block/node. See the right block example on my front page.

A OPEN
I'm here =)
Penang, Malaysia
  • Since it requires content with javascript, I would recommend creating a 'Raw format' input format with no filter. Go to administer » input formats and add a new input format, I name mine 'Raw'.
  • Next, get the Chouser's Google Maps EZ javascript. See attachment below of this blog for the file.
  • Request a free key for the Google Maps API.
  • Create a block/node and insert the following code:
    		<script src="http://maps.google.com/maps?file=api&v=1
    	&key=yourgoogleapikey" mce_src="http://maps.google.com/maps?file=api&v=1
    	&key=yourgoogleapikey" type="text/javascript">
    	</script>
    	<script src="http://yoursite.com/gmapez.js" 
    	type="text/javascript">
    	</script>
    	<div class="GMapEZ" style="width: 300px; height: 300px;">
    	</div>
    	
  • More customization can be done following these example snippets.
That's all, have fun with your map. Thanks Josh for the tip.
AttachmentSize
gmapez.zip2.37 KB