簡體   English   中英

Google Maps API v3控件顯示在地圖后面

[英]Google Maps API v3 controls showing up behind map

問候和問候,

這是我第一次使用google maps API,我正在使用WordPress和Genesis Framework,

我正在通過http://tympanus.net/codrops/2011/04/13/interactive-google-map/上的教程進行學習

而且我已經得到了一張Google地圖以顯示在地圖頁面上,

http://www.foodtrucksnashville.com/map/

但是,您會注意到地圖控件位於地圖下方。 嗯。

不知道。 需要幫助/朝正確的方向輕推。

再次,stackoverflow社區。

這是init.js中的代碼:

var map, geocoder, marker, ey, my, mouseDown = false;

var o = {
    init: function () {
        this.map.init();
    },
    map: {
        size: function () {
            // so it's a loverly sqware.
            var w = jQuery('.content-sidebar #content').width(),
                h = 440;
            return {
                width: w,
                height: h
            }
        },
        data: {
            zoom: 13,
            center: new google.maps.LatLng(36.165389, -86.783237), // Nashville TN Capitol BLDG
            scrollwheel: false,
            mapTypeId: google.maps.MapTypeId.ROADMAP
        },
        init: function () {
            // get the map size
            var size = o.map.size();
            // add some css to the #map div based on the size
            jQuery('#map').css({
                width: size.width,
                height: size.height,
            });

            // make a new google map in the #map div and pass it the map data
            map = new google.maps.Map(document.getElementById('map'), o.map.data), geocoder = new google.maps.Geocoder();
            /*
            // add eventlistener to map to hide posts when dragging?
            google.maps.event.addListener(map, 'dragstart', function () {
                jQuery('.posts').hide();
            });
            */
        }
    } // end map
} // end o object

jQuery(window).load(function () {
    o.init();
});

我的問題來自css文件上的z-index。 試圖一一禁用,直到我找到它。

figure.rounded img {
width: 100%;
z-index: -1;  /*  Here he is  */
position: relative;
-webkit-border-radius: 8px;
-moz-border-radius: 8px;
border-radius: 8px;
}

終於弄清楚了發生了什么,在Google組上找到了Maps API v3的解決方案,

http://code.google.com/apis/maps/documentation/javascript/forum.html?place=topic%2Fgoogle-maps-js-api-v3%2F8dOLhjNQzmo%2Fdiscussion

我的孩子主題中埋藏了一些css屬性,這些圖像以最大寬度為100%的圖像為目標。

一旦我刪除了所有針對具有最大寬度的img元素的引用,生活又變得古怪。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM