Stop observing window resize when map disposed

2 posts / 0 new
Last post
cbaxter
Stop observing window resize when map disposed

Hi,

More of a bug than an enhancement... using `open.mapquestapi.com/sdk/js/v7.2.s/mqa.toolkit.js`, there appears to be a call to observe a window resize via the following call:

AR.observe(window,"resize",function(){Ay.setSize()});

When the map is diposed via map.dispose(), the resize event does not appear to be cleaned up and results in an `Uncaught TypeError: Cannot read property 'style' of null` if the window is resized after the map is destroyed (i.e., setSize fails). I suspect that the dispose should call stopObserving(window, "resize", Ay.setSize) and not wrap the handler in an anonymous function when registering event to avoid having to track the registered event handler. Perhaps I am overlooking something to properly clean-up the window resize event when disposing a map instance?


MQBrianCoakley
Thanks for the heads up. I'll
Thanks for the heads up. I'll forward this on to the team.