3

I integrate my openlayer map in a div with rounded corners. How can I get the map to have rounded corners? I have tried to apply border-radius to many divs in developer tools but the map refuses to get rounded corners.

Alex

Alex
  • 2,117
  • 5
  • 28
  • 36

1 Answers1

6

This worked for me;

JS Fiddle

#demoMap
{
    position: relative;        
    width: 200px;
    height: 200px;
    left: 20px;
    top: 20px;
    -moz-border-radius: 15px;
    border-radius: 15px;
    border: 1px solid black;
    overflow: hidden;
}

I think you probably just needed to add

overlfow: hidden;

to your CSS style, as the openlayers API just uses your div as a placeholder for it to insert many more elements.

Update

After reading the comment on Chrome I tried to get it working with Chrome but that does not seem to be possible after reading border-radius in Chrome bug? and CSS Border radius not trimming image on Webkit and using chromes dev tools to modify the element styles.

Community
  • 1
  • 1
Dampsquid
  • 2,456
  • 15
  • 14
  • @Dampsquid: o.k., so it is a chrome bug. I am developing on chrome... thanks a lot! – Alex Dec 11 '12 at 22:24