我无法弄清楚Google Maps InfoWindow无法正常显示的原因。屏幕截图如下:
知道可能导致这种情况的原因吗?
这是代码(js):
/**
* Basic Map
*/
$(document).ready(function(){
var map = new GMaps({
el: '#basic_map',
lat: 51.5073346,
lng: -0.1276831,
zoom: 10,
zoomControl : true,
zoomControlOpt: {
style : 'SMALL',
position: 'TOP_LEFT'
},
panControl : false,
});
map.addMarker({
lat: 51.5073346,
lng: -0.1276831,
title: 'Big Ben',
infoWindow: {
content: 'Big Ben is the nickname for the great bell of the clock at the north end of the Palace of Westminster in London, and often extended to refer to the clock and the clock tower, officially named Elizabeth Tower.'
}
});
});
的CSS:
.map {
display: block;
width: 95%;
height: 350px;
margin: 0 auto;
-moz-box-shadow: 0px 5px 20px #ccc;
-webkit-box-shadow: 0px 5px 20px #CCC;
box-shadow: 0px 5px 20px #CCC;
}
HTML:
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true"></script>
<script type="text/javascript" src="https://raw.github.com/HPNeo/gmaps/master/gmaps.js"></script>
...
<div id="basic_map" class="lg-map"></div>
答案 0 :(得分:1)
该问题由http://dev.contractorshire.co.uk/assets/components/articles/themes/default/style.css:
中定义的以下格式强制执行img { background: #FAFAFA; border: 1px solid #DCDCDC; padding: 8px; }
将此添加到CSS中以覆盖地图内图像的背景设置:
#basic_map img{background:none}