地理编码与GoogleMaps同步 [英] Geocode sync with GoogleMaps

查看:52
本文介绍了地理编码与GoogleMaps同步的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在Google Map的标记上放置Info Window.我进行了Ajax查询,以获取要在地图中绘制的标记列表,但由于存在以下问题,我出现了同步问题:

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?

推荐答案

查看以下答案 Google同步地图API地理编码.答案是不.

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

这篇关于地理编码与GoogleMaps同步的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆