Fix zoom and pan bugs in location nav javascript