40 How to easily add interactive Google Maps to your Blogger posts
Monday, February 2, 2009 /

Adding Google Maps integration to your web projects can offer visitors a more interactive experience of your website and assist the understanding of where events or business takes place.



In a recent project, I decided to utilize Blogger to create a website for a local business, and found that including Google Maps was of great benefit for visitors to understand where the business is located. However, of the many tutorials on the web which explain how to add Google Map functionality to our websites, I was unable to find clear instructions for how maps can be added to a Blogger powered blog.



Luckily I discovered two simple and highly useful techniques for adding Google Maps to blog posts with no editing of the template required.



In this post, I'll explain just how easy it is to add interactive Google Maps to your blog posts, which can offer your readers further insight into events, business or other local information which are relative to your site or blog posts.







An Overview of Google Maps and Blogger

Bloggers write for many different reasons: some to log their daily activities or keep in touch with friends and family; others to publicize their business, or earn an income online by providing useful and informative articles.



No matter what the genre of our subject matter, there may well be times when area maps relevant to our posts may enhance the experience for our readers. A family blogger for example could illustrate their holiday destination, while a business blog could demonstrate the location of their shops.



While Blogger's recent "Geotagging" feature proves useful to many Bloggers, there are times when nothing less than an actual map will do. And when you consider the interactivity offered by Google Maps (2d maps, sattelite views and even driving directions), the prospect of adding such a feature to our blogs becomes even more enticing!



Here, for example, is a map of Downing Street in London, England:





View Larger Map



Using this map, you can easily switch between the 2-dimensional map, a satellite view and even the terrain of the ares. You can move the map in any direction to see the surrounding area; zoom in and out for a closer/distant view, and incredibly you can link to driving directions too!



Such interactive elements can add a huge amount of interest to your posts, and can assist reader's interaction with your site, whether this be a deeper understanding of the locations you write about, or to help potential customers find out where your business is based.



There are two main methods you could use to add customizable Google Maps to your blog posts:

Neither of these options requires you to edit your Blogger template in order to add these maps to your posts (or even your sidebar, if you prefer this location). Whats more, these can be added simply by copying and pasting a section of code to your posts.



Let's go through each of these methods in turn and explain the circumstances in which these would be most useful.





Adding an Iframe generated by Google Maps

I personally find this to be the easiest and most reliable method of adding Google Maps to Blogger posts.



To begin, simply visit the Google Maps website and type in the location you wish to display:



For example, if I wanted to display a map of The White House, I would type: "The White House, Washington DC, United States". The search results would then be displayed in a screen like this (click on the image for a larger preview):



If nescessary, we can narrow down the location by clicking one of the links on the left in order to get a more accurate map.



Once we have the map we would like to embed in our Blogger post, we need to retrieve the code required to display it.



To do this, click on the "Link"icon at the top right of the map:



In the pop-up, click "Customize and preview embedded map". This enables us to tweak the dimensions of the map to ensure it fits well within our blog post.



If you are using a default Blogger template, I would advise you to use the "Small" option which will measure 300px in width. This ensures the map will not overlap the space you have available for your blog posts which could mess up the overall layout of your blog.



In cases where you use a widened posts column, you could choose a larger map size or even specify your own dimensions. As a guide, the medium map size is 425px wide while the large embed is 640px. Your selection will automatically generate a new preview which gives a good idea of how well this will fit into your Blogger template design.



Finally, copy all of the code in the third section of this page to your clipboard. We will paste this into our Blogger post shortly.





How to embed the iframe code in your Blogger posts

To add your iframe code to a post, simply crewate a new post and paste the iframe code where you would like your map to appear within the post.



There are no hard and fast rules about how to embed the iframe code in your posts, though I do have some suggestions based on my own experiences:

  • Using Blogger in Draft to write your posts makes the process easier! Just ensure the compose settings are set to "Interpret typed HTML", then you can use either the "Compose" or "Edit HTML" version depending on your personal preferences.

  • If you prefer to use the regular Blogger post editor, ensure you paste the iframe code when using the "Edit HTML" tab, not the rich text composer. Unless you paste the iframe code in the Edit HTML page, your maps will not display properly.

  • It can be easier to write your entire post, then paste the iframe code afterwards, where you would like your map to be displayed. This ensures you don't accidentally delete any of the code when editing, which would render your maps useless.

You should be able to preview how your post will appear after pasting the iframe code into your post, regardless of whether you use Blogger in Draft or the regular post editor, so be sure to check how everything looks before hitting the publish button!





When using Google's simple embedded maps may not be perfect for your needs

Using this simple embed code does not offer complete control over how your maps will appear. If you prefer to use a custom marker or more than one reference point on your maps, you would need a more advanced solution and extensive HTML code.



For a more customized option, I would advise you to check out KabaWeb's Google Maps creator which offers a simple interface for such advanced usage of Google Maps.





Using KabaWeb's Google Maps Creator

KabaWeb's Google Maps Creator allows greater control over how your maps and any information about the locations are displayed. Here for example is a map of 10 Downing Street in London with my choice of marker and a more personalized information bubble:























Using this version of an embedded Google Map is slightly more complicated that using the code generated by Google, though it is most useful to have greater control over the content of your maps.





Generating a Google Maps API key

In order to use the Google Maps Creator, you will need access to your own Google Maps API key, which you can generate from the API sign-up page.



To generate your key, you should accept the terms and conditions for use, then add your blog's URL where prompted. Your API key will be specific to your site, so you cannot use the same key elsewhere. This also means you cannot preview how the maps will appear within your posts (as the URL for preview pages will be different from that where your posts are published).



Once your API key has been generated, copy this long string of numbers and letters to Notepad or your favorite text editor. You will need to access this again soon.





Generating your maps

Once you have your API key saved, you can then generate your maps on the Google Maps Creator page.



Here you can set the following options depending on your requirements:



  • Your map's name

  • The location you wish to display. The preferred format for accuracy seems to be STREET-NAME, TOWN, COUNTRY.

  • Map height and width: the default setting for width is 700px, too wide for most Blogger post sections. Be sure to reduce this to accomodate the settings for your own template

  • Zoom size: unless you prefer to display a town or country view, you can leave the default setting of 14px

  • Map Control: This chooses whether to display controls to the left of the map which visitors can use to zoom in and out

  • Show map types bar: This chooses whether to display the switch to toggle between map, satellite and hybrid views.

  • Show overview inset: This chooses whether to display the inset in the bottom right of the map, which offers a quick overview.

  • Info Text: This is the text displayed in the balloon overlay. You can use plain text or HTML code to style how your informative text will appear.

Once you have changed the settings for your preferences, click the "Generate this map" button, which will update the map preview beneath to show how your embedded map will appear.





Embedding the map in your Blogger post

Once you have generated the map you wish to display, you can use the code provided to paste into your Blogger post (or an HTML/JavaScript widget in your sidebar).



To find the correct code, scroll right down the page until you see the section marked "Portable Code". This is the section of code which is best to use with Blogger powered blogs.



Copy the entire section of code in this box to your clipboard, then switch over to your Blogger post editor.



Be sure you have completely written your blog post before pasting the code for your map, especially if you are using the regular post editor (not Blogger in Draft). When attempting to use this version of an embedded Google Map, I have encountered errors when attempting to edit the post after embedding the code.



If you are using the regular post editor, switch to the Edit HTML tab and paste your code where you would like your map to appear. Then replace "YOURKEY" in the third line with the API key you obtained from the Google Maps developer pages. Then finally, publish your post.



Be sure not to switch back to the "Compose" tab after pasting the code for your map! If you do, the code will become corrupted and your maps will not display properly in the page.



When using Blogger in Draft to compose your posts, it is not necessary to switch to the "Edit HTML" tab. However, it is still advisable to paste the code only after you have finished writing your post, and do not switch between the different post editors.



Once you have published your post, you can take a look at your new maps in your blog posts!





Final thoughts

While Blogger's new Geotagging feature offers an interesting way to add locations to our posts, it is often the case where nothing less than a map will suffice in the understanding of our post content! Using the methods described above, you can easily add interesting and interactive Google Maps to your Blogger posts, ensuring your readers have a deeper understanding of the locations mentioned in your posts.



If you know of other simple methods to add maps to Blogger posts, please feel free to let us know by leaving your comments below.

40 comments:

February 4, 2009 at 4:02 AM Azis said...

It's very nice Amanda ... I will try it in my blog ... Thnk's .

February 4, 2009 at 5:29 AM Kampanye Damai Pemilu Indonesia 2009 said...

I think this is very useful for blogger and help on Kampanye Damai Pemilu Indonesia 2009
Nice post amanda.
Success n Hv A nice day

February 4, 2009 at 4:16 PM Rev. Fr. Jessie Somosierra,Jr. said...

Yes, you are right, you have to finished posting your blog before you paste the google map code. I have been using it for some time. Kabaweb is something new to me. Thankyou for the information.

February 4, 2009 at 5:11 PM Muhammad Noval said...

wao nice tips..thank my syster

February 4, 2009 at 8:31 PM Ir. hydir said...

Superb... for travelling blog..it is a must ..
maybe in my blog also can put this geo map.. the route to the stadium for a soccer match!


KBSoccernet.com

February 5, 2009 at 6:02 PM CELEBS said...

I think Geotagging feature must be good for normal blogger like us or in case this too is wonderful to display the exact location and give readers a clear idea of the place.I hope this can also be used by bloggers to show thier own blogging location.
Great Thanks.

February 5, 2009 at 6:34 PM z-vet said...

Thanks Amanda, great tip!

February 6, 2009 at 11:04 AM
Bill said...

The KabaWeb map doesn't show up in Google Reader.

February 7, 2009 at 7:05 AM yulius said...

waoww.. nice info n i will try that :)

February 7, 2009 at 11:15 AM Ozo said...

thanks, i will try on a new blog ill be doing soon!
www.wii4everybody.com

February 8, 2009 at 5:24 AM saintaaron83 said...

Hey I read your post and found it very informative, I have a similar system in place which I use for travel blogging and geo tagging pictures while away updating with only a mobile phone, check it out id love to hear your thoughts!
www.mobiletravelblog.com
My Travel blog:
http://aaronandgeorgie.typepad.com/

February 8, 2009 at 9:35 AM ador said...

Thanks. Will try this soon.

February 8, 2009 at 5:33 PM Bang Ir said...

I will try it in my blog ... Thank's.

February 9, 2009 at 1:37 AM BlogViet.INFO said...

Great post, I will try this too

February 10, 2009 at 10:57 PM Ches said...

It is very great post.

February 10, 2009 at 11:06 PM Jon Fredkove said...

This will enhance the experience in many ways. I could see using it when blogging about a ski trip to show the terrain. It might also be handy when liveblogging a conference.

Thanks for the detailed explanation.

February 13, 2009 at 10:28 PM Drew said...

Thanks so much! Another informative post!

I think this could be EXTREMELY useful in showing where your offices or business are located in compliment to written directions on a blog or even on a website!

February 14, 2009 at 7:15 PM Erik said...

Thx Amanda.
Great Post

February 18, 2009 at 5:23 AM Rahul Jadhav said...

Great post.Thanks a lot Amanda. Love you

February 18, 2009 at 10:17 AM Ricardo said...

Great!!! It's all I need for my blog!
Please visit it to see how feel

http://voltaaomundogoogleearth.blogspot.com/

Thanks (PS.: I am from Brazil)

February 18, 2009 at 11:12 PM Hendrawan said...

OK... its too difficult to me :)

February 21, 2009 at 7:40 AM pajolo said...

nice info amanda....thank's

February 23, 2009 at 3:04 AM
Anonymous said...

Hi,
Can you please writ post about (Image Protection) or how to make the transparent image for blogger blog.
I try this code in this link but it's not working for me.
http://javascript.about.com/library/blimgprot.htm

thank's

February 26, 2009 at 1:07 AM Ishan said...

This is a really cool idea. I will definitely try it out on my blog sometime.

Save Few Bucks

March 1, 2009 at 5:07 AM Kampanye Damai Pemilu Indonesia 2009 said...

Great idea to get more interactive by Google Map.

March 10, 2009 at 12:19 AM amieysa said...

nice thing to give it a try and add into the blog but quite frustrated with google maps, since my last browse, the map is still the same and outdated (suppose there is a new building).

is the map live (satellite view) or ...? when is the last google maps updated? any idea?

March 10, 2009 at 8:28 PM Aileen said...

Thank you so much! I am planning to add this to my site when I find time.

March 19, 2009 at 9:31 AM
LJM said...

Nice tips! Thanks

www.macri.blogspot.com

April 9, 2009 at 12:14 PM egierestu-care.blogspot.com said...

wow your blog is great, the sites indonesian rarely a problem map

good luck ...


egie restu, Indonesian

April 10, 2009 at 4:28 AM GoRoam said...

For any commenters who think this is too complicated, they should check out GoRoam's Geomapper tool. With a little copy-and-pasting, you can quickly and easily put a map on your page, then geotag images, text, and links so they appear on the map: http://geo.goro.am

April 17, 2009 at 4:37 AM Asif said...

Thanks a lot for suggestions.

Infomist Services

April 20, 2009 at 4:52 AM Natalie Giddings said...

very informative....giddy up!

April 30, 2009 at 2:21 AM
Anonymous said...

Thanks for your great explanations!

Is there a way to add a Google Map to your blog AND allow users to put in there own location to get directions to the map in the blog?

May 3, 2009 at 2:16 PM marketing internet said...

this is usefull article

May 3, 2009 at 9:31 PM
Anonymous said...

How do you add a map and allow the user to get directions to and from locations on your map?

May 26, 2009 at 6:45 AM Meghanadh Yerneni said...

Nice & Great Work, Keep it Amanda!!!!!!!!!

June 21, 2009 at 9:15 AM d_rahmad said...

Hi Amanda..
It doesn't work on my blog..
http://www.the-vacationnotes.blogspot.com/

What might cause it?

August 16, 2009 at 1:22 AM Rusli said...

Oh nice post, thanks :-)

Post a Comment