I display my custom tiles with OpenLayers and I have set .olImageLoadError{display: none !important;} in my CSS to avoid displaying pink empty tiles (as described at How to avoid Pink tiles when DB view/Table is empty?).

In this way empty tiles are not displayed at first, but if I switch off and on my layer, empty tiles are visualized, as depicted in the upper right corner of the following image:

enter image description here

I'm not the only one having this problem (see here), but I did not find a solution so far.

How do I solve this?


2 Answers 2


It appears to be an OpenLayers bug.

Upgrading from version 2.12 to 2.13 solved this issue for me.


If this problem is related to server side error, you can try to produce transparent empty tile for this problem when error occurred (Since part of a layer cannot be produced; in my opinion, this problem is related to server side).

If it is related to client side problem (like, not able to send request to server or receive tile); You can try these parameters:


  • OpenLayers.Util.onImageLoadErrorColor = "transparent";

  • I've tried this solution, it is described in the question I linked above, but it doesn't work. I visualize my custom tiles which are on my filesystem with a OpenLayers.Layer.XYZ using a custom get_my_url function. It works perfectly in panning and zooming, but I visualize empty squares after switching off/on layers. Empty tiles requested does not exist in the filesystem but the first time I try load them, the CSS property works. Toggleing the layer, it doesn't.
    – caneta
    Jun 14, 2013 at 14:32
  • I have no idea why this problem occurs after hide and display layer again. Since these solutions does not work, may be you can try to populate empty transparent tiles on disk.
    – mdoflaz
    Jun 15, 2013 at 9:51

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