Move marker click offset calculation to mousedown event handler