Hi! I thought about a more general approach but discarded it, because I don't know about OL internals too much and, more importantly, about what other people might want to do. So this patch works for me and if you want to take it up into the OL trunk, thats great, but if not I'll just use it in my copy of the code.
Jochen On Tue, Aug 25, 2009 at 02:24:03PM -0600, Tim Schaub wrote: > Date: Tue, 25 Aug 2009 14:24:03 -0600 > From: Tim Schaub <tsch...@opengeo.org> > To: dev@openlayers.org > Subject: Re: [OpenLayers-Dev] Patch: NavigationHistory tracks base layer > changes > > Hey- > > 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. > > Tim > > > I use this at http://bestofosm.org/ . > > > > Jochen > > > > > > ------------------------------------------------------------------------ > > > > _______________________________________________ > > Dev mailing list > > Dev@openlayers.org > > http://openlayers.org/mailman/listinfo/dev > > > -- > Tim Schaub > OpenGeo - http://opengeo.org > Expert service straight from the developers. > _______________________________________________ > Dev mailing list > Dev@openlayers.org > http://openlayers.org/mailman/listinfo/dev > -- Jochen Topf joc...@remote.org http://www.remote.org/jochen/ +49-721-388298 _______________________________________________ Dev mailing list Dev@openlayers.org http://openlayers.org/mailman/listinfo/dev