[OpenLayers-Dev] ticket 2593 in OpenLayers 2.10

Bart van den Eijnden bartvde at osgis.nl
Wed Sep 22 03:53:44 EDT 2010


Hi Marc,

I am forwarding a reply by my colleague Marco Nijdam on this issue:

Yes, setting a breakpoint reveals the flaw(s) in the current code:

* With single tile layer, and transitionEffect not set, when zooming in
 the first time, ratio = 2 and this.lastRatio = 1. Goto line 536.
 No transitionEffect, so block of line 537 onward is skipped.
 No backbuffering. Ok.
 Line 578: this.lastRatio = ratio == 2.

* Zooming in immediately afterwards:
 ratio again 2, this.lastRatio now also 2. Goto line 572.
 Single tile, so backbuffer shown. This is the image as it was before
 zooming, so wrong to show that (over the already zoomed in tiled
 baselayer).
 Line 578: this.lastRatio = ratio == 2.

* Now immediately afterwards pan the layer.
 ratio now 1, but this.lastRatio still 2. Goto line 536.
 No transitionEffect, so block of line 537 onward is skipped.
 No backbuffering! The intention of the change was for single tile layer
 to do backbuffering!
 Line 578: this.lastRatio = ratio == 1.

* Now pan again. This time ratio and this.lastRatio both 1, so goto
 line 572. Now backbuffering happens for single tile, as was intended.

One solution, as suggested, is to reset this.lastRatio in the
resetBackBuffer method. But I wonder if this.lastRatio is at all needed.
Shouldn't ratio be always compared to 1? If not 1, we zoom, if 1 we pan.

Kind regards,
--
-- Marco Nijdam
--

-- 
Looking for flexible support on OpenLayers or GeoExt? Please check out http://www.osgis.nl/support.html

Bart van den Eijnden
OSGIS
bartvde at osgis.nl

On Sep 22, 2010, at 12:09 AM, Marc Pfister wrote:

> Bart van den Eijnden (OSGIS) wrote:
> 
>> are you sure?
>> 
>> http://trac.openlayers.org/changeset/10675
>> 
>> reads:
>> 
>> if ((OpenLayers.Util.indexOf(this.layer.SUPPORTED_TRANSITIONS,
>> this.layer.transitionEffect) != -1) ||  this.layer.singleTile) {
>> 
>> and singleTile is true.
> 
> This will turn on the transitions in a generic sense, but the actual transitions of the backbuffered image don't occur until line 535:
> 
> 533	        // if the ratio is not the same as it was last time (i.e. we are
> 534	        // zooming), then we need to adjust the backBuffer tile
> 535	        if (ratio != this.lastRatio) {
> 536	            if (this.layer.transitionEffect == 'resize') {
> 537	                // In this case, we can just immediately resize the
> 538	                // backBufferTile.
> 
> If you are zooming, your transitionEffect should be empty and the backbuffering skipped.
> 
> If you're panning and not zooming, then you jump to line 572:
> 
> 
> 568	            // default effect is just to leave the existing tile
> 569	            // until the new one loads if this is a singleTile and
> 570	            // there was no change in resolution.  Otherwise we
> 571	            // don't bother to show the backBufferTile at all
> 572	            if (this.layer.singleTile) {
> 573	                this.backBufferTile.show();
> 574	            } else {
> 575	                this.backBufferTile.hide();
> 576	            }
> 
> The singleTile layer will backbuffer in panning, maintaining the visual continuity of the panned layer.
> 
> Since your problem occurs in the zoom, can you set a breakpoint in the block around line 539 and see if it trips?
> 
> - Marc



More information about the Dev mailing list