[OpenLayers-Users] little bug by using NavigationHistory and setBaselayer

Max Weidemann max.weidemann at freenet.de
Thu Oct 22 05:21:11 EDT 2009


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.

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'nt save it in the Array.

Thanks for any help.

With kind regards
Max Weidemann 
-- 
View this message in context: http://n2.nabble.com/little-bug-by-using-NavigationHistory-and-setBaselayer-tp3871212p3871212.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.



More information about the Users mailing list