OpenLayers OpenLayers

Ticket #795 (closed feature: fixed)

Opened 1 year ago

Last modified 1 year ago

give Layer a redraw() method

Reported by: euzuro Assigned to:
Priority: minor Milestone: 2.5 Release
Component: Layer Version: 2.4
Keywords: Cc:
State:

Description

For ages, people have been abusing the mergeNewParams() and moveTo() functions when all they really want is a "redraw".

Attachments

redraw.patch (1.7 kB) - added by euzuro on 07/03/07 15:50:35.
create redraw function, apply it in the couple of relevant places
redraw.2.patch (2.7 kB) - added by euzuro on 07/03/07 15:57:02.
found a couple more instances of redraw() usage
redraw.3.patch (3.9 kB) - added by euzuro on 07/03/07 21:04:42.
fix the conflict with Markers layer instead of magic wizardry, just move the extant "redraw" logic to the moveTo function (where it gets called from). Then we can just erase the redraw function completely from Markers, since it will inherit it from Layer.js and have the exact same functionality (that was hard to figure out).
redraw.4.patch (6.2 kB) - added by tschaub on 07/04/07 11:49:13.
same as 3 above but with tests and 2 other cases where redraw could be used

Change History

07/03/07 15:50:35 changed by euzuro

  • attachment redraw.patch added.

create redraw function, apply it in the couple of relevant places

07/03/07 15:57:02 changed by euzuro

  • attachment redraw.2.patch added.

found a couple more instances of redraw() usage

07/03/07 15:59:23 changed by euzuro

tests are not yet passing. sorry. let me correct this...

07/03/07 21:04:42 changed by euzuro

  • attachment redraw.3.patch added.

fix the conflict with Markers layer instead of magic wizardry, just move the extant "redraw" logic to the moveTo function (where it gets called from). Then we can just erase the redraw function completely from Markers, since it will inherit it from Layer.js and have the exact same functionality (that was hard to figure out).

07/03/07 21:08:54 changed by euzuro

  • keywords set to review.
  • milestone set to 2.5 Release.

final patch is #3. all tests pass in ff and ie6. note that we are talking about a net addition of ONE LINE to OL codebase here. net gain: sweet new readable redraw() function. pretty sweet.

someone please approve this...

07/04/07 11:25:20 changed by tschaub

  • keywords changed from review to commit.

nice work - please commit!

07/04/07 11:49:13 changed by tschaub

  • attachment redraw.4.patch added.

same as 3 above but with tests and 2 other cases where redraw could be used

07/04/07 11:51:56 changed by tschaub

Ok, see if you like the latest. I added a return for layer.redraw() - determines whether the layer was redrawn. Also, 8 tests. Also, seems to me like these setUrl functions mean to redraw the layer as well (does anybody use these?).

Tests (new ones too) pass.

Commit if you approve.

07/05/07 10:05:28 changed by euzuro

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

phenomenal. thanks so much for adding the tests to this. r3582

07/05/07 16:53:18 changed by euzuro

  • keywords deleted.