BjartN
BjartN

Reputation: 5487

Increase timeout for tiles in OpenLayers

I have an OpenLayers XYZ-layer. When loading the layer some of the tiles does not show up. However if I reload the tile it shows up (a.k.a there is nothing wrong with the tile). Seems to me OpenLayers has some kind of timeout mechanism, and won't render the tile if it takes too long.

Does anybody know how to increase the timeout ?

Upvotes: 3

Views: 3018

Answers (1)

Fran Verona
Fran Verona

Reputation: 5476

I think that is not possible to do that. I had the same problem few months ago, and the best solution I found was to set OpenLayers.IMAGE_RELOAD_ATTEMPTS constant.

OpenLayers.IMAGE_RELOAD_ATTEMPTS is a variable to specify how many times do you want to try to reload tiles when its reach timeout.

You just need to include this sentence at top of your own code and playing with its value to set the best for you:

OpenLayers.IMAGE_RELOAD_ATTEMPTS = 5;

I hope it helps.

Upvotes: 3

Related Questions