开发者

Geocode sync with GoogleMaps [duplicate]

开发者 https://www.devze.com 2023-02-21 19:03 出处:网络
This question already has answers here: Google Maps API Geocode Synchronously (3 answers) 开发者_C百科
This question already has answers here: Google Maps API Geocode Synchronously (3 answers) 开发者_C百科 Closed 1 year ago.

I need to put Info Window on markers in a Google Map. I make an Ajax query to get a list of markers to draw in my map and I have a sync problem because the:

geocoder.geocode( { 'address': citta}, function(results, status) {
    if (status == google.maps.GeocoderStatus.OK) {}

Is asynchronous so if I call it inside a loop I get the wrong results. Can anyone tell me if there is a way to do a synchronous call?


See the following answer Google Maps API Geocode Synchronously. The answer is no.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号