Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Maps as background

Is there a sexy way to get a web page with Google Maps (in fullscreen), and just a small div#header on the top and a small div#container on the middle?

I had make some research and I had found this example: http://koti.mbnet.fi/ojalesa/exam/index.html ... but this is not exactly what I would like to do.

If you have a thin code example of a nice website example, this would help me a lot.

Many Thanks.

like image 446
Puru puru rin.. Avatar asked Apr 07 '10 18:04

Puru puru rin..


People also ask

How do I change Google Maps back to white background?

If you want to switch back to the white landscape, head back into Settings > Theme > and click on the Always in Light Theme option.

What is a background map?

Background map refers to a raster map or OCAD file used as a background. It serves as a drawing template or background image. Examples include scanned draft maps, satellite pictures, orthophotos or relief shadings.


3 Answers

You can position HTML elements randomly on top of a (HTML based) Google Map using position: absolute or position: fixed. You just need to give them a z-index higher than that of any element in the Google map.

Untested but something along these lines should work:

<style type="text/css">
  .Overlay { position: absolute; left: 0px; top: 0px; 
             right: 0px; height: 50px; background-color: white; z-index: 100 }
</style>

... Fullscreen Google Map (or whatever)..... 

<div class="Overlay">I'm on top of a Google Map!</div>
like image 121
Pekka Avatar answered Oct 14 '22 07:10

Pekka


If you hold the iframe for Google maps in a div with position: relative, and make the div the same dimensions as the iframe, you can then use position: absolute on other elements within the relatively positioned div to overlay them where you want on the GMap. You may need to tinker with the z-index css property of the content you wish to position over GMap.

like image 41
Finbarr Avatar answered Oct 14 '22 06:10

Finbarr


Here's a nice writeup of how it's done:

http://blog.wadehammes.com/post/3837158298

like image 38
oivvio Avatar answered Oct 14 '22 06:10

oivvio