Welcome!

New Here? Welcome!
Be sure to subscribe to get the latest tips by email.
Scroll down to the topics or use our custom search.
Drop us a comment, and we'll source an answer for you.

Embedding Google Maps? Simple Code Tweak to Avoid Overlaps

Quick Tip Helps Keep Embedded iFrames From Spilling Over!

Google Maps and YouTube, are just two of the commonly embedded elements people add to their blogs and websites using iframes. When you first set up iframe content, it may look very nice, but should you narrow the column in which they are embedded, they can spill over, creating a mess of your blog or page. This problem can be easily avoided with this simple tweak.

What Map Overlap Looks Like

The screen shot below shows one of my previous problems, before I learned this trick-not a pretty site eh?

Google Map Before Tweaking

Google Map overlap before

Google Map After Tweaking

Google Map Overlap Gone Problem Solved

What Causes This Google Map Overlap Problem ?

Where this Google Map overlap problem stems from, is the choices people are given for embedding Google maps, YouTubes, Flickr pictures,and other such properties. I had chosen to embed a map that was 435 wide, as you can see in the code below:
Here is the code I had embedded:
  <iframe frameborder="0" height="350" marginheight="0" marginwidth="0" scrolling="no" src="http://maps.google.ca/maps/ms?hl=en&amp;ie=UTF8&amp;msa=0&amp;msid=213602822130861661201.00049ff85311300ba4a5b&amp;ll=44.370987,-78.54126&amp;spn=0.171791,0.291824&amp;z=11&amp;output=embed" width="425"></iframe>
<small>View <a href="http://maps.google.ca/maps/ms?hl=en&amp;ie=UTF8&amp;msa=0&amp;msid=213602822130861661201.00049ff85311300ba4a5b&amp;ll=44.370987,-78.54126&amp;spn=0.171791,0.291824&amp;z=11&amp;source=embed" style="color: blue; text-align: left;">Omemee Area Church Services</a> in a larger map</small>
Therefore, when I made my column size 300, the iframe spilled over into the adjacent column.

Google Map Overlap Solution

There is a simple trick which can be used to remove this overlap- just change the width value to a percentage of the column width-as shown below:
  <iframe frameborder="0" height="350" marginheight="0" marginwidth="0" scrolling="no" src="http://maps.google.ca/maps/ms?hl=en&amp;ie=UTF8&amp;msa=0&amp;msid=213602822130861661201.00049ff85311300ba4a5b&amp;ll=44.370987,-78.54126&amp;spn=0.171791,0.291824&amp;z=11&amp;output=embed" width="100%"></iframe>
<small>View <a href="http://maps.google.ca/maps/ms?hl=en&amp;ie=UTF8&amp;msa=0&amp;msid=213602822130861661201.00049ff85311300ba4a5b&amp;ll=44.370987,-78.54126&amp;spn=0.171791,0.291824&amp;z=11&amp;source=embed" style="color: blue; text-align: left;">Omemee Area Church Services</a> in a larger map</small>

An Ounce of Prevention

By using the value of 100%, rather than a number value, I’m preventing my Google Maps from overlapping into other columns, when I change the size of my columns. You can choose whichever percentage suits your needs,for example if you want the map to be only half the size of the column,use 50% rather than 100%.

Caveat:

While this method may work for Google maps, if you use it when embedding pictures you may find Aunt Bertha’s bottom changes to comical proportions when you change your column width. There must be a tweak to this code out there to keep the picture proportions, If you find a tweak that will maintain picture proportions and allow them to automatically adjust with column width, please share!

It’s Your Turn. Please drop me a comment. Did this work for you? How are you using iframes? Hopefully, you will find this tweak helpful. Did you find what you were looking for today? If not, please let me know, I may have the answer tucked in the back office waiting for some tweaking!
Suzanne

2 comments:

Height Data said...

 With more people searching the Internet for reviews before choosing a specific company, your business will want to make the most of this highly accessible opportunity.

Mahbuba said...

 Really Amazing Blog!!!
I have found this blogs posts very helpful. No doubt you will get more heigh ranks in various keywords. I have already linked a backlink with your site.

I really appreciate your teaching quality. I like this post. So, I'm going to post a comment here.
Anyway you can also visit my Blogger Tips and Tricks blog for a great dealing.
How to add Google Map in blogger

Get Blogged Tips by eMail

Enter your email address:

Delivered by FeedBurner

Blogged Tips Search

There was an error in this gadget
Related Posts Plugin for WordPress, Blogger...