OpenLayers OpenLayers

Ticket #2317 (closed feature: fixed)

Opened 5 months ago

Last modified 4 months ago

Create a possibility to refresh a layer every N seconds

Reported by: krisgeus Assigned to: jlacroix
Priority: minor Milestone: 2.9 Release
Component: Strategy Version: 2.8
Keywords: Cc:
State: Complete

Description

For a client i need to refresh a layer every N seconds. I first implemented that in the application itself but after the foss4g presentation of tschaub i realized it was a usecase for a strategy.

Attachments

refreshStrategy.patch (4.2 kB) - added by krisgeus on 10/22/09 05:26:53.
refresh strategy patch file
refreshStrategy-withBasicTests.patch (9.0 kB) - added by krisgeus on 10/30/09 11:23:18.
Added some basic tests, more to follow
refreshStrategy-withMoreTests.patch (11.1 kB) - added by krisgeus on 11/04/09 10:28:58.
Adde dmore tests. Please review and perhaps suggest more test scenarios
ticket2317.patch (9.9 kB) - added by bartvde on 11/09/09 09:02:57.
updated patch (minor changes)

Change History

10/22/09 05:26:07 changed by krisgeus

  • status changed from new to assigned.

10/22/09 05:26:53 changed by krisgeus

  • attachment refreshStrategy.patch added.

refresh strategy patch file

10/22/09 05:28:12 changed by krisgeus

  • owner deleted.
  • status changed from assigned to new.
  • state set to Review.
  • component changed from general to Strategy.

10/23/09 06:08:10 changed by krisgeus

  • keywords changed from refresh strategy to refresh strategy foss4g09.

10/24/09 00:26:44 changed by ahocevar

  • owner set to jlacroix.

10/30/09 10:18:14 changed by bartvde

krisgeus, any chance you can write up a few testcases for this new strategy? TIA.

10/30/09 11:23:18 changed by krisgeus

  • attachment refreshStrategy-withBasicTests.patch added.

Added some basic tests, more to follow

11/04/09 10:28:58 changed by krisgeus

  • attachment refreshStrategy-withMoreTests.patch added.

Adde dmore tests. Please review and perhaps suggest more test scenarios

11/09/09 09:02:57 changed by bartvde

  • attachment ticket2317.patch added.

updated patch (minor changes)

11/09/09 09:08:03 changed by bartvde

Hi Chris, this looks good to go (great code!). I've made a few changes (mostly variable naming more in line with other OL code, like interval instead of refreshTime, and some whitespace issues/tabs). OpenLayers uses no tabs but 4 spaces instead. Also there were a few trailing comma's preventing tests to run in IE. They now pass in FF3 and IE6.

I have changed some things from APIProperty or APIMethod to Property or Method, can you have a quick look at that (it will give us the most flexibility to change things in the future)? Is my assumption correct that a user will stop the timer by deactivating the strategy, and not by calling stop directly on the strategy etc?

Also, do we have a ICLA or CCLA from you already? I don't see you in the list at: http://trac.openlayers.org/wiki/CLA See: http://trac.openlayers.org/wiki/HowToContribute for more details.

Thanks in advance.

11/09/09 09:08:43 changed by bartvde

  • state changed from Review to Awaiting User Feedback.

(follow-up: ↓ 9 ) 11/09/09 09:09:45 changed by bartvde

I meant Kris instead of Chris ... :-)

(in reply to: ↑ 8 ) 11/09/09 09:37:36 changed by krisgeus

hi Bart,

i reviewed your changes and agree fully with them. It is indeed not wanted to call stop directly from the user side. By deactivating the strategy or changing the visibility of the layer the interval is stopped.

about the CLA: I remember i have sent a icla (to christopher i think) a long time ago. If its needed to supply a fresh/new one please let me know.

Kris

11/09/09 09:43:59 changed by bartvde

  • keywords deleted.
  • status changed from new to closed.
  • state changed from Awaiting User Feedback to Complete.
  • resolution set to fixed.

(In [9790]) Create a possibility to refresh a layer every N seconds: OpenLayers.Strategy.Refresh, excellent patch by krisgeus, r=me (closes #2317)