[英]Showing Floor Button Controls with Google Maps Javascript 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的解决方案,
我的孩子主题中埋藏了一些css属性,这些图像以最大宽度为100%的图像为目标。
一旦我删除了所有针对具有最大宽度的img元素的引用,生活又变得古怪。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.