Leaflet: Map tiles are not clipped by border-radius in Webkit

Created on 26 Mar 2013  路  8Comments  路  Source: Leaflet/Leaflet

Setting border-radius on the #map div does not affect the map itself. Not sure if this is a bug in Webkit, Leaflet, or expected behavior. Looks good in Firefox and IE 9.

Caroline DES

Most helpful comment

I got this to work in chrome (v38.0.2125.122) by adding z-index: 0 to the map container if that helps anyone.

All 8 comments

This is a browser bug. :( Not possible to fix from Leaflet side as far as I know. I wanted to add border radius to examples on the website but no luck...

Same thing here with Chrome only. I just put a 1px white border around the map div and it's good enough for me. As long as it's a light map. Not worth the effort to research with my skill set.

I got this to work in chrome (v38.0.2125.122) by adding z-index: 0 to the map container if that helps anyone.

@gwithian wow, really surprised that this fixes it.

Thank you so much for this answer <3

Hey, I tried @gwithian trick and it works well, even with another value. Seems that just to specify a z-index make it work (Chrome Version 49.0.2623.112 )

@gwithian thanks, it works

@gwithian this neat little trick works in Safari too - thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

edmsgists picture edmsgists  路  3Comments

viswaug picture viswaug  路  4Comments

onethread picture onethread  路  3Comments

arminghm picture arminghm  路  3Comments

CallMarl picture CallMarl  路  3Comments