[OpenLayers-Trac] [OpenLayers] #1240: navigation history control

OpenLayers trac at openlayers.org
Mon Jan 7 13:43:55 EST 2008


#1240: navigation history control
----------------------+-----------------------------------------------------
  Reporter:  tschaub  |       Owner:             
      Type:  feature  |      Status:  new        
  Priority:  minor    |   Milestone:  2.6 Release
 Component:  Control  |     Version:  2.5        
Resolution:           |    Keywords:             
     State:           |  
----------------------+-----------------------------------------------------
Comment (by pspencer):

 Hi Tim, random thoughts ...

 I'm not sure if this is good programming practice or not, but the way I
 implemented a similar control for Fusion was to use a class variable for
 the state so it was shared between all instances of the widget, and each
 instance then had a direction (forward or backward).  I used a single
 "historychanged" event that the widget registered for on itself so that
 each instance could decide whether to be enabled or not depending on the
 current index into the history stack.  This class variable approach could
 be used for the current two stack implementation.

 Or the history could be stored as part of the Map and the API for
 next/previous could exist there as well.  Not sure that I like this idea,
 but I thought I'd throw it out there anyway.

 I do prefer two buttons over one.  There also may be some advantage to
 tying into the browser's forward/back buttons and using a framework like
 http://code.google.com/p/reallysimplehistory/.

 Another thought that occurred to me is that it may be desirable to have
 generic do/undo that includes anything that could be pushed onto the
 stack.  This is much more ambitious and would require pushing an object
 that is capable of undoing / redoing something like an extent change.

-- 
Ticket URL: <http://trac.openlayers.org/ticket/1240#comment:10>
OpenLayers <http://openlayers.org/>
A free AJAX map viewer


More information about the Trac mailing list