[OpenLayers-Users] Retile in OL 2.11

Moises Arcos moiarcsan at gmail.com
Tue Jan 26 05:40:52 PST 2016


Hi all,

I have a problem with OpenLayers 2.11 when I change the zoom level,
OpenLayers forces base layer to retile current tiles.

I'm talking about moveTo function in Grid.js, where following code exists:

// if grid is empty or zoom has changed, we *must* re-tilevar
forceReTile = !this.grid.length || zoomChanged;

It is some piece of code which was added 9 years ago in version 2.5 and
stayed there until now (2.13.1), so I don't think it would be a bug, but I
just don't understand why it is needed. I mean, if zoom changed and I'm
going to load new tiles, why to request for current tiles in the first
place, if I'm going to change them anyway?

Under which conditions (if any) would it be safe to change the previous
code to:

// only if grid is empty, we *must* re-tilevar forceReTile = !this.grid.length;

in order to reduce requests in my GIS?
If someone could enlight me, it would be very appreciated.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/openlayers-users/attachments/20160126/0d829829/attachment.html>


More information about the Users mailing list