I am encountering issues with the CSS border-radius property on a div element that contains an OpenLayers (OL3) map. The border-radius on a div element with the map replaced by a .png background gives the desired result, so this question is specific to the OL3 case. Using a border-radius of 50% gives a circular map for some operating system/browser combinations, not for others. Specifically I get the following behaviour:
Ubuntu Firefox - works, Chrome - works
Windows IE - works, Chrome - doesn't work
Mac OSX/iOS Safari - works AND doesn't work (when using the "show all tabs" option, the border-radius IS APPLIED, not so in normal window view), Chrome - doesn't work
I have unsuccessfully searched stackoverflow and the web for systematic solutions. I have found the WebKit CSS Mask hack on How to make CSS3 rounded corners hide overflow in Chrome/Opera, but I am hoping that maybe somebody has an idea of what the underlying issue is? Given that the OS/browser combination seems to play a role and that in OSX/iOS the "show all tabs" view behaves differently from the normal window?
Here is a link to a jsfiddle illustrating the problem (or not, depending on OS and browser) http://jsfiddle.net/t0y9bbqw/. The code is:
HTML
<body>
<div id="map" class=map></div>
</body>
CSS
.map {
height:600px;
width: 600px;
-webkit-border-radius:50%;
-moz-border-radius:50%;
border-radius:50%;
overflow:hidden;
margin:auto;
position:relative;
}
JS
var my_layer = new ol.layer.Tile({
source: new ol.source.MapQuest({layer: 'sat'})
})
var map = new ol.Map({
target: 'map',
layers: [my_layer],
view: new ol.View({
center: [-12245.6653498,6704064.05491],
zoom: 10,
}),
});
I would be very grateful for any insight into what might be going on here! Thanks!