Safari不会将边框半径应用于Gmaps

时间:2014-09-09 09:40:26

标签: google-maps safari css3 rounded-corners

我遇到了Safari及其与边界和圆角相关的着名bug的问题。我要将Gmap放在一个圆圈内,当然,我的代码适用于除Safari之外的所有浏览器。我无法解决。

这是我的代码

CSS:

#map-container {
  position: relative;
  margin: 0 auto;
  top: 50%;
  transform: translateY(-50%);
  -webkit-transform: translateY(-50%);
  -ms-transform: translateY(-50%);
  z-index: 9999; 
}

#map-container.round-center {
  overflow: hidden;
  height: 350px;
  width: 350px;
  border-radius: 175px;
  -webkit-border-radius: 175px;
  -ms-border-radius: 175px; 
}

#map-container #map {
  position: absolute;
  height: 350px;
  width: 350px;
  border-radius: 175px;
  -webkit-border-radius: 175px;
  -ms-border-radius: 175px; 
}

HTML:

<div id="map-container" class="round-center">
  <div id="map"></div>
</div>

JS:

function loadmap() {
    var mapOptions = {
        center: new google.maps.LatLng(-34.397, 150.644),
        zoom: 8,
        disableDefaultUI: true 
    };
    var map = new google.maps.Map(document.getElementById("map"),
        mapOptions);
}

loadmap();

我知道这个问题已被提出,但我无法解决这些问题。我已经开了一个新问题,因为我认为这可能是与谷歌地图有关的问题,而且我没有看到任何有关此问题的话题。

提前致谢。

编辑:

This is a screenshot of the result in Chrome

0 个答案:

没有答案