Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove Black Header from Google Maps Embed Iframe

Please take a look at this example.

http://jsfiddle.net/Lscxuyhe/

Code looks like following:

<iframe src="https://www.google.com/maps/d/u/0/embed?mid=zUN79N8r2n1E.kLstghIFzhKU" width="640" height="480"></iframe>

I created custom google maps. Now can't remove black header (Untitled map written)from top of maps iframe. Googled a lot. Nothing found.

Any suggestions?

like image 748
heron Avatar asked Jan 14 '15 06:01

heron


1 Answers

You can hide all buttons with css. Create a containder div width overflow on hidden and the sizes you need. Place the new google maps iframe/embed inside with a largersize. To position the maps iframe use negative marges..

Example with 100% width:

<div style="width: 100%; overflow: hidden; height: 300px;">
  <iframe 
     src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d39797.07748547086!2d5.46683904751879!3d51.433965676849986!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x47c6d90575ca5e3d%3A0x55989f5f344b006!2sPrins+Hendrikstraat+5!5e0!3m2!1snl!2snl!4v1392716144537"
     width="100%"
     height="600"
     frameborder="0"
     style="border:0; margin-top: -150px;">
  </iframe>
</div>

Make the iframe 300px higher than your container div. 150px to hide below and 150px to hide on top. To hide this 150 on the top of the iframe use:

margin-top: -150px;

like image 77
Alex Avatar answered Sep 22 '22 10:09

Alex