[OpenLayers-Users] found little bug NavigationHistory / setBaseLayer

Eric Lemoine eric.lemoine at camptocamp.com
Thu Oct 29 13:07:21 EDT 2009


On Wednesday, October 21, 2009, Max Weidemann <max.weidemann at freenet.de> wrote:
>
> Hi List,
>
> i found a bug by using the NavigationHistory control.
> If you change the baselayers of a map (for Example in the layerswitcher) the
> NavigationHistory registers an moveend Event and saves the same state of the
> map again.
> if you now try to use the NavigationHistory Control to switch to a previous
> state you have to click multiple times.
> I think this effekt is caused by calling the setCenter function in the
> setBaseLayer function.
>
> I have 2 ideas for solving this Problem and would like to know wich is the
> smartest or if there are smarter solutions.
>
> 1. unregister the moveend event before calling the setCenter function and
> after that register it again.

(I replied to this email this morning, but it looks like my reply
didn't get through)

there may be code relying on moveend being triggered when switching
base layer, so I don't think we should go that path

>
> 2. checking the first entry in the previousStack Array of the
> NavigationHistory-control and compare it with the current map state. if they
> are equal i would not save it in the Array.

doing something like that would make sense to me.

Cheers,

-- 
Eric Lemoine

Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex

Tel : 00 33 4 79 44 44 96
Mail : eric.lemoine at camptocamp.com
http://www.camptocamp.com



More information about the Users mailing list