1

我无法弄清楚为什么 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>
4

1 回答 1

1

该问题是由http://dev.contractorshire.co.uk/assets/components/articles/themes/default/style.css中定义的以下格式造成的:

img {
    背景:#FAFAFA;
    边框:1px 实心#DCDCDC;
    填充:8px;
}

将此添加到您的 CSS 以覆盖地图内图像的背景设置:

#basic_map img{background:none}
于 2013-04-01T10:42:33.337 回答