OpenLayers OpenLayers

Ticket #1017 (closed bug: fixed)

Opened 1 year ago

Last modified 1 year ago

Remove clear() from Layer's moveTo()

Reported by: euzuro Assigned to: euzuro
Priority: minor Milestone: 2.6 Release
Component: Tile Version: 2.5 RC3
Keywords: Cc:
State:

Description

Especially in the case of the singleTile layer, we don't want to clear the tile until we're ready to actually redraw it with the new data. Waiting for a response from a server can make this look ugly.

we *do*, however, need to mark the tile's 'drawn' property as false, because other parts of the code depend on that flag to know how to deal with it.

Attachments

clear.patch (1.6 kB) - added by euzuro on 09/27/07 02:02:24.

Change History

09/27/07 02:02:24 changed by euzuro

  • attachment clear.patch added.

09/28/07 08:43:46 changed by openlayers

Hi Erik,

this does not solve the flash problem in my testcase unfortanately:

http://openlayers.org/pipermail/users/attachments/20070921/87e98332/attachment.html

Do comment out the layer.grid[0][0] = null; line in the example since this will cause js errors.

It seems the clear in moveTo is causing this, but we need this one since when zooming in you don't want the old image to be there, only when the extent does not change IMHO.

Any ideas?

Bart

(follow-up: ↓ 4 ) 09/28/07 08:54:49 changed by openlayers

I added a check for a change of bounds in the moveTo of Tile.js which works for me:

moveTo: function (bounds, position, redraw) {

if (redraw == null) {

redraw = true;

} if (!this.bounds.equals(bounds)) {

this.clear();

} this.bounds = bounds.clone(); this.position = position.clone(); if (redraw) {

this.draw();

}

},

So when zooming, the tile will be cleared, when you are running something like a WMS timeseries with a timer, the bounds will not change, and the map will not flash.

09/28/07 12:53:32 changed by sderle

  • keywords set to commit.

This patch is the first part of the flashing bug solution. Erik and Paul are working on the other part, so I'll mark this ready to commit.

(in reply to: ↑ 2 ) 09/28/07 13:07:49 changed by euzuro

Replying to openlayers:

I added a check for a change of bounds in the moveTo of Tile.js which works for me: moveTo: function (bounds, position, redraw) { if (redraw == null) { redraw = true; } if (!this.bounds.equals(bounds)) { this.clear(); } this.bounds = bounds.clone(); this.position = position.clone(); if (redraw) { this.draw(); } }, So when zooming, the tile will be cleared, when you are running something like a WMS timeseries with a timer, the bounds will not change, and the map will not flash.

Hi Bart, I can't *quite* see what you're trying to get at with this, but I think it's a different problem. This ticket is not supposed to solve the flash problem, though it is a step in the right direction.

It looks like we'll be working on this a bit today with Paul, so let's see where we can go with it.

-E

09/28/07 13:11:19 changed by euzuro

  • keywords deleted.
  • status changed from new to closed.
  • resolution set to fixed.

(In [4502]) Fix to remove extraneous clear() from Tile.moveTo (Closes #1017)