简体   繁体   中英

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 (aka 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 ?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM