I'm using openlayers to display a google base-map layer and it works fine on Firefox/IE/Safari. I'm having problems with Chrome as the tiles have a small white space between them shown in this image.

enter image description here

I found this discussion about invasive CSS which suggested the problem was due to

Your theme is "helpfully" adding margins to img tags. you can override this with

.openlayers-map img{ margin:0px }

I'm unclear where I put this line. I read through the openlayers CSS file but I don't have a good idea what is going on, on where I should be editing the img tag.

  • I had this problem and as @tmcw said is because of the zoomm of the page (not the map) in Google Chrome.
    – user53654
    Commented Jun 12, 2015 at 12:33

4 Answers 4


There are two possibilities. The more likely is that you have Chrome zooming the page in or out, which introduces the white lines. Do cmd-0 (or ctrl-0) and see if that fixes it.

Otherwise, add that line to your CSS file, which might be site.css or whatever. Add it to the bottom, though it doesn't matter much. A live example would make this question easier to fix / diagnose.

  • 2
    Nicely spotted - it was due to zooming. Thank you.
    – djq
    Commented Mar 26, 2012 at 19:39
  • 3
    This behaviour isn't unique to Openlayers, I see the same with ESRI ArcGIS Javascript API and zooming in Chrome.
    – kes
    Commented May 13, 2015 at 9:39

That's something that has to do with Open Layers 2.12 and above, regarding the way that deals with the image tiles. I tried different things related to CSS and nothing changed. In my case, we decided to keep with Open Layers 2.11. and the white space were gone.


I think that some where a Round() is used instead of Floor(). That makes the tile shift a sigle pixel and makes these lines appear.


Same issue for me. Reverting to 2.11 has corrected.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.