[OpenLayers-Users] _attempts counter (of tile image) never seems to
be reset?
michaeladamkatz
michaeladamkatz at yahoo.com
Thu Dec 8 18:04:06 EST 2011
I am using a local tile server to serve XYZ tiles. (I'm actually using the
tiles for an overlay layer, not a basemap layer, but I don't think that is
relevant.)
I would sometimes get missing tiles -- grid spots on the map where a tile
should be drawn but wasn't. After adding some diagnostic logs in certain
places in Image.js and Util.js, it seems to be simply a matter that the
_attempts variable that gets attached to the tiles imgDiv never gets reset.
I see that only about 28 total tile objects are ever created, and this pool
of tiles is recycled as I zoom and pan around the map. Once in a while, by a
combination of quick panning and zooming (especially several quick pans
followed immediately by a sequence of three or four very quick zooms in or
out), I can get an image load to fail, triggering the
OpenLayers.Util.onImageLoadError() function. I have
OpenLayers.IMAGE_RELOAD_ATTEMPTS set to 3. It appears that in general each
load only fails once or twice. But since _attempts never gets reset, it
keeps accumulating, so after several tile objects have two or three failures
it is easy to get one more and have the tile not draw. So obviously the
problem gets worse as a given session goes on.
So it seems like the simple fix is just to reset _attempts to zero once
there is a successful load. But I just wanted to check if that makes sense,
since it seems like such a blatant error that maybe there's something I'm
not understanding.
Thanks for any help.
--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/attempts-counter-of-tile-image-never-seems-to-be-reset-tp7076265p7076265.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
More information about the Users
mailing list