Another option would be to call Google on the change event on the query textbox, store the result somewhere, and then use it in buildingQuery. But this means you might have queries with no geo information if they are executed "too fast" (ex: user types and presses enter - a frequent scenario).

All in all I'd look at my first suggestion first :) Maybe someone else can suggest a better answer, too.