Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

hide top bar in embedded google map

I have an embedded Google Map on a webpage. I had to use a map attached to a gmail account because I'm using multiple locations.

The map has a partially opaque bar at the top, that I'd like to get rid of. Each time the map is loaded, the bar has a different (unique) class, so I can't easily hide it using CSS.

I even tried some jQuery, because the sibling before it always has the class of .gm-style so I tried this:

    $(function() {
        // hide google title bar on map
        setTimeout(function(){
                $(".gm-style").next().hide();                       
        },5000);                
    });             

but that didn't work.

Is there some easy way that I'm missing to hide that bar?

enter image description here

like image 382
Shawn Avatar asked Aug 10 '15 19:08

Shawn


People also ask

How do I hide the bars on Google Maps?

They announced it in the Google Maps Help forum saying: We've heard your feedback that that you'd like to be able to see the entire map by hiding the search box and side panel. To hide the panel, go to the right of the panel and click the arrow.

Can you hide UI in Google Maps?

Disabling the UI Default ControlsWe can disable the default UI controls provided by Google Maps simply by making the disableDefaultUI value true in the map options.


2 Answers

you cant hide the topbar where the name its and you can no longer use the top-30px since they trimming the button part i guess google find out. but you can use the clipping create a div and place you iframe in it give it an id and add a css to it.

 #div_id{
overflow:hidden;
    clip-path: polygon(0 10%, 100% 10%, 100% 100%, 0% 100%);
}
like image 34
GADI ROSALES Avatar answered Oct 20 '22 10:10

GADI ROSALES


You cannot hide the toolbar. But you can use this code below to make it disappear by tweaking with the height and width of what can be viewed.

<div style="height:160px; border:2px solid #eee; display:inline-block; overflow:hidden;">
<iframe style="position:relative; top:-30px; border:none;" 
      src=" Source to the map " 
      width="What Ever Width" height="What ever height"></iframe>
</div>

You can tweak with the " top:-30px; " to add spacing or move it up or down based on what the actual set value is.

like image 63
Mohamed Islam Avatar answered Oct 20 '22 09:10

Mohamed Islam