开发者

Increase timeout for tiles in OpenLayers

开发者 https://www.devze.com 2023-02-19 23:55 出处:网络
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

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 ti开发者_如何学JAVAmeout ?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号