How to Make Drupal Display a Google Map
Google has been mapping the world and creating a huge online database of maps for many years. Incorporating this information into your Drupal-based website can be as simple or as complicated as you desire. You can share any Google map with a couple of clicks of your mouse, or -- for more customization -- use Google's map application programming interface, or API, to expand your Drupal site.
Instructions
-
-
1
Log in to your Drupal site with the administrator login and password, or with your personal username if you have author permissions. Create or edit a piece of content that you wish to include your Google map on. Add all of the content for the page before you insert the map, including an introduction to the map, if desired, and any additional information that you think is pertinent.
-
2
Load a Google map in another browser window and tinker with the map until it displays exactly like you want it to show up in the Drupal page. For example, if you want to have your users start at a zoomed-in point on the map, zoom to that point before copying the code. When you have the map displayed like you want, click the "Link" button above the map. Google presents you with a direct link to this map and also with an embed "iframe" code. Highlight this embed code and press "Ctrl" and "C" to copy it to the clipboard.
-
-
3
Switch back to the Drupal window and insert a couple of blank lines in the document you are working with. If you aren't familiar with HTML coding, type "Insert map here" so you can find the place in the document where the map will go, then click "View Source" on the to reveal the HTML code for this page. Scroll through the code until you find the place where you want to insert the map -- or until you find "insert map here" -- and press "Ctrl" and "V" to paste the code for the Google map.
-
4
Close the HTML editor. Don't worry if the map doesn't appear right away -- Drupal's WYSIWYG editor might not show the "iframe" until you save your work.
-
5
Save the document.
-
1
Tips & Warnings
This method is the simplest way to embed a map on your Drupal site, but doesn't allow for much customization. You can use Google's map API to include maps on your site with data of your choosing, which allows you to create custom overlays. For example, if you want to show a certain set of restaurants on a Google map on your Drupal-based site, API is the only way to do this. Google offers expansive tutorials at code.google.com.