Assigned to vars to avoid global variables. Added map bounds event liste...

...ner. Refactored.