Ticket #2317 (closed feature: fixed)

Opened 4 years ago

Last modified 4 years ago

Create a possibility to refresh a layer every N seconds

Reported by: krisgeus Owned by: 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 Download (4.2 KB) - added by krisgeus 4 years ago.
refresh strategy patch file
refreshStrategy-withBasicTests.patch Download (9.0 KB) - added by krisgeus 4 years ago.
Added some basic tests, more to follow
refreshStrategy-withMoreTests.patch Download (11.1 KB) - added by krisgeus 4 years ago.
Adde dmore tests. Please review and perhaps suggest more test scenarios
ticket2317.patch Download (9.9 KB) - added by bartvde 4 years ago.
updated patch (minor changes)

Change History

  Changed 4 years ago by krisgeus

  • status changed from new to assigned

Changed 4 years ago by krisgeus

refresh strategy patch file

  Changed 4 years ago by krisgeus

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

  Changed 4 years ago by krisgeus

  • keywords foss4g09 added

  Changed 4 years ago by ahocevar

  • owner set to jlacroix

  Changed 4 years ago by bartvde

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

Changed 4 years ago by krisgeus

Added some basic tests, more to follow

Changed 4 years ago by krisgeus

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

Changed 4 years ago by bartvde

updated patch (minor changes)

  Changed 4 years ago 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.

  Changed 4 years ago by bartvde

  • state changed from Review to Awaiting User Feedback

follow-up: ↓ 9   Changed 4 years ago by bartvde

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

in reply to: ↑ 8   Changed 4 years ago 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

  Changed 4 years ago by bartvde

  • keywords refresh strategy foss4g09 removed
  • 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)

Note: See TracTickets for help on using tickets.