問候&問候,谷歌地圖API V3控制顯示身後地圖
這是我與谷歌地圖API第一次運行, 我使用WordPress和創世紀框架,
我的工作通過對 http://tympanus.net/codrops/2011/04/13/interactive-google-map/
,我已經得到了谷歌地圖,顯示了地圖頁面上的教程,
http://www.foodtrucksnashville.com/map/
但是,您會注意到地圖控件位於地圖下方。嗯。
不知道。需要幫助/推動正確的方向。
thx再次,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();
});
設置z-index爲-1的一個div幫助了我。 – 2013-11-29 05:41:07