Overlay DIV on Google Maps

user1110562

I am trying to position a div as an overlay on top of a Google Map. I can't seem to keep it contained within the Google Maps div though.

#wrapperMap {
   position: relative;

}

#over {

background: #000000;
position: absolute; 
top: 120px; 
left: 10px; 
z-index: 99;
width: 20%;
height: 380px;
opacity: 0.9;
filter: alpha(opacity=90);
color: #FFFFFF;
}


<div id="wrapperMap">

                <div id="map-canvas2" style="width: 100%; height: 400px; border: 16px solid #e2e1e0;"></div>
                </div>


                <div id="over">

                        <br />

                        <div align="center">
                        <ul class="no_bullet">
                            <li class="school">SCHOOLS</li>
                            <li class="res">RESTAURANTS</li>
                            <li class="rec">RECREATION</li>
                            <li class="shop">SHOPPING</li>
                        </ul>
                        </div>

                </div>

            </div>

You can also see what is currently happening here, under "Current Projects -> Amenities" tab.

RGLSV

Ok, if you manage to get both the #over and #map-canvas2 inside a separate wrapper, you can pull it off pretty easy like so:

  • this wrapper that holds both these ids, set it to relative positioned, so that any absolute positioned children, will be bound to this parent;
  • the overlay thingy, #over, set it to position: absolute, and if you want it to stretch to its parent height, then either use 100% height, or use top and bottom props.(dont forget to take into account any borders,margins etc.)
  • and that should do it.

Check out the example here and hopefully this will help you out.

이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.

침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제

에서 수정
0

몇 마디 만하겠습니다

0리뷰
로그인참여 후 검토

관련 기사

분류에서Dev

Overlay an image on google maps android api v2

분류에서Dev

Google Maps Hidden Div Overflows half map

분류에서Dev

맞춤 마커 Google Maps Street View Xcode for text overlay

분류에서Dev

Google Maps Overlay Tiles: JSON base64 ajax call instead of image URL

분류에서Dev

Float a div over google maps while maintaining bootstrap responsiveness

분류에서Dev

Google Maps V3 Custom Overlay 어린이가 마우스 이벤트 수신을 중지했습니다.

분류에서Dev

Google Maps div가 JSBin에 표시되지 않음

분류에서Dev

외부 div google maps api v3에서 정보 창 닫기

분류에서Dev

How to set up image DIV for overlay animation

분류에서Dev

how to set overlay for div on click in jquery

분류에서Dev

Hover on FusionTablesLayer in google maps

분류에서Dev

Render google maps with backbonejs

분류에서Dev

Limitation Google maps

분류에서Dev

Google Maps mangling KML

분류에서Dev

Remove google maps controls

분류에서Dev

Google Maps mangling KML

분류에서Dev

Google Maps REST API

분류에서Dev

Google Maps Directions API

분류에서Dev

Google Maps Autocompletion API

분류에서Dev

Google Maps multiple maps displayed instead of one

분류에서Dev

Google Maps API가 background-attachment : fixed와 겹치는 div와 충돌합니다.

분류에서Dev

Google Maps Mobile SDK for Business와 Google Maps Android API

분류에서Dev

angular-google-maps, access to regular google maps API

분류에서Dev

Blazor : Google Maps JS API

분류에서Dev

Google Maps MarkerCluster 및 Spiderfier

분류에서Dev

Google Maps not working using jQuery

분류에서Dev

c# google maps coordinates

분류에서Dev

Google Maps APIv2

분류에서Dev

Disable Google Maps zoom amount