<div dir="ltr"><span style="font-size:12.8px">Hi all,</span><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">I have a problem with OpenLayers 2.11 when I change the zoom level, OpenLayers forces base layer to retile current tiles.</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">I'm talking about moveTo function in Grid.js, where following code exists:</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px"><pre style="white-space:pre-wrap;margin-top:0px;margin-bottom:1em;padding:5px;border:0px;font-size:13px;overflow:auto;width:auto;max-height:600px;font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,sans-serif;color:rgb(57,51,24);word-wrap:normal;background-color:rgb(238,238,238)"><code style="margin:0px;padding:0px;border:0px;font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,sans-serif;white-space:inherit"><span style="margin:0px;padding:0px;border:0px;color:rgb(128,128,128)">// if grid is empty or zoom has changed, we *must* re-tile</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">
</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,139)">var</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> forceReTile </span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">=</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> </span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">!</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,139)">this</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">.</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">grid</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">.</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">length </span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">||</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> zoomChanged</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">;</span></code></pre></div><div style="font-size:12.8px"><div>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?</div><div><br></div><div>Under which conditions (if any) would it be safe to change the previous code to:</div></div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px"><pre style="white-space:pre-wrap;margin-top:0px;margin-bottom:1em;padding:5px;border:0px;font-size:13px;overflow:auto;width:auto;max-height:600px;font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,sans-serif;color:rgb(57,51,24);word-wrap:normal;background-color:rgb(238,238,238)"><code style="margin:0px;padding:0px;border:0px;font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,sans-serif;white-space:inherit"><span style="margin:0px;padding:0px;border:0px;color:rgb(128,128,128)">// only if grid is empty, we *must* re-tile</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">
</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,139)">var</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> forceReTile </span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">=</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> </span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">!</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,139)">this</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">.</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">grid</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">.</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">length</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">;</span></code></pre></div><div style="font-size:12.8px"><div>in order to reduce requests in my GIS?</div><div>If someone could enlight me, it would be very appreciated.</div></div></div>