[OpenLayers-Dev] Patch: NavigationHistory tracks base layer changes

Tim Schaub tschaub at opengeo.org
Tue Aug 25 16:24:03 EDT 2009


Jochen Topf wrote:
> Hi!
> Enclosed a small patch to optionally also track base layer changes in the
> NavigationHistory Control. Just set the trackBaseLayerChange option to true.
> Default is false, ie. old behaviour.

Nice to see how small the change is.  However, I feel like this is 
pretty application specific.  Another application might want to restore 
layer visibility (though this takes it even farther from a navigation 
history control).  And this patch wouldn't work with an application that 
allowed layers to be removed.

I can imagine a patch that added a couple events to the control.  When a 
change event was fired, any listener could modify the state object. 
When a restore event was fired, a listener could use any custom state 
properties to restore the state.

Since this control only listens for "moveend" it will always be a 
navigation history control.  Firing events and letting applications 
decide how to represent and restore state doesn't muddle the purpose of 
the control in the library.

If you're interested in this (events based approach), I'd be happy to 
review a patch (attached to a ticket).  Though I'll likely need a ping 
to remember to check it out.


> I use this at http://bestofosm.org/ .
> Jochen
> ------------------------------------------------------------------------
> _______________________________________________
> Dev mailing list
> Dev at openlayers.org
> http://openlayers.org/mailman/listinfo/dev

Tim Schaub
OpenGeo - http://opengeo.org
Expert service straight from the developers.

More information about the Dev mailing list