geocoder sync/async

1,917 views
Skip to first unread message

shaf

unread,
Nov 7, 2009, 9:25:46 AM11/7/09
to Google Maps JavaScript API v3
Hello all,

Is there a way of setting the geocoder to synchronous rather than
asynchronous?

Esa

unread,
Nov 7, 2009, 10:56:34 AM11/7/09
to Google Maps JavaScript API v3
No. You just have to make use of javascript function closure to make
sure that the callback function works in right scope.

In your case, if you are going to create the map by geocoder callback,
you should form a separate function that creates the geocoder request.
The situation is analogous to creating 'click' listeners.
http://econym.org.uk/gmap/basic1.htm

shaf

unread,
Nov 7, 2009, 11:55:42 AM11/7/09
to Google Maps JavaScript API v3
TBH, I cannot see any way of achieving that. async just executes the
code and then whenever the reply is recieved its proccessed. I just
dont see how I can restrict its scope or atleast limit it. The only
way am I do this is by having to code my own ajax functions.

Ben Appleton

unread,
Nov 7, 2009, 10:52:10 PM11/7/09
to google-map...@googlegroups.com

No: in general browsers have no way to block on a HTTP request.

Reply all
Reply to author
Forward
0 new messages