Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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 here).

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.

Have you got any idea on how to solve this?

Thank you.

share|improve this question
    
Doe the selected answer in your linked question solve the problem? I mean something like this: .olImageLoadError {background-image:url('images/blank.png');} –  Mingfeng Jun 14 '13 at 13:01
    
It doesn't solve it: I've tried every combination described in the linked question, but they works only on layer first load. If I toggle my layer with layer.setVisibility(false); and then layer.setVisibility(true);, I get the image above. –  caneta Jun 14 '13 at 14:24
    
you should show some code, it'd be easier to get more support in that way. –  Gery Jun 14 '13 at 17:16
add comment

2 Answers

What is reason behind pink tiles? Related to server response or client side problem? How you provide tiles?

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.IMAGE_RELOAD_ATTEMPTS = 2;

  • OpenLayers.Util.onImageLoadErrorColor = "transparent";

share|improve this answer
    
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 '13 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. –  mahmutoflaz Jun 15 '13 at 9:51
add comment
up vote 0 down vote accepted

Ok, it should be an OpenLayers bug: upgrading from version 2.12 to 2.13 solved this issue for me.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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