IE7 -谷歌地图(GMap)重置IE7的高度和宽度



我在谷歌地图上设置了多个标记,包括infoWindow内容,它在FF, GC, IE9,8上工作完美

但是在IE7中地图变得很小(40px x 30px)

以下是我的<div>

    <div id="listing-map-view" style="width:610px;height:380px;">
</div>

下面是GmapCall

var bounds = new google.maps.LatLngBounds();
var map;
var userinput = "40.860294,-73.183374";
var latlong = userinput.split(",");
var lat = latlong[0];
var long = latlong[1];
$(document).ready(function(){
   map = new GMaps({
     div: '#listing-map-view',
     lat: lat,
     lng: long
   });
bounds.extend (new google.maps.LatLng (lat ,long));
map.addMarker({
lat: lat,
lng: long,
infoWindow: {content: 'Some Test Content'},
zoom:10,
mapTypeId:google.maps.MapTypeId.ROADMAP
});
map.fitBounds(bounds);
});

通过添加以下样式修复了位置相对错误

/*Google Map Fixes for IE */
  #listing-map-view{
    z-index: 1000!important;  /*Outer DIV*/
    position:relative!important;
    width:610px!important;
    height:375px!important;
    padding: 0 15px!important;;
  }
  #listing-map-view > div{
    z-index: 500!important;   /*Actual DIV with the map*/
    position:absolute!important;
  }

最新更新