developmentseed/af-polling-search — pull request #27 by kamicut (2014-04-03 23:46:09+00:00)
Title: Fix switching between views.

I think this fixes #18 by removing event listeners on zooming in and out. Instead we set a timeout to delay the drawing of the markers. The 'moveend' event listener was affecting the auto-map functionality after switching from manual to auto.

I also added a button event listener on the locator because after dragging the map you might want to try autolocation again. It wasn't working before because if you're on the #/auto-map route it wouldn't trigger a refresh of the page (no-hash change).