1

我的广泛目标是生成一个给定城镇 100 英里范围内所有浸信会教堂的列表。

在谷歌地图上,我可以输入“北卡罗来纳州的浸信会”,然后我会得到一张覆盖着小红点的地图,每个红点都是名称中带有“浸信会”一词的位置。

我想创建一个包含所有这些结果的表格,其中包含格式化的地址和 lat/lng。

我一直在尝试的方法是使用地理编码请求传递“北卡罗来纳州的浸信会”作为地址。我想我之后可以进去交叉检查到我正在寻找的城镇中心的所有距离。

function returnChurches() {
  sAddr = "Baptist in NC";
  dOut = document.getElementById("divChurchList");
  dOut.innerHTML = "";
  myGeocoder.geocode({'address':sAddr}, 
    function (results, status) {
      if (status == google.maps.GeocoderStatus.OK) {
        // alert(results[0].geometry.location);
        // alert(results.length);
        for (i = 0; i < results.length; i++) {
          dOut.innerHTML += results[i].formatted_address + "<br>";
          mrkrIdx = mrkrChurch.push(new google.maps.Marker({
              map: map,
              position:results[i].geometry.location, title:results[i].formatted_address, icon:pinImageClient, myField:results[i].formatted_address
          }));
        }
        for (i in mrkrChurch) {
          google.maps.event.addListener(mrkrChurch[i], 'click', fChurch(mrkrChurch[i], mrkrChurch[i].myField, map));
        };
        map.setCenter(results[i - 1].geometry.location);
      } else {
        alert("Geocode was not successful for the following reason: " + status);
      }
    }
  );
}

不幸的是,这只给了我大约 15 个罗利周围的“浸信会”地点(罗利是北卡罗来纳州的首府)。我想要在 Google 地图上输入“北卡罗来纳州浸信会”时返回的完整列表。

有谁知道获取完整列表的方法?其他一些函数或库?

谢谢!

4

1 回答 1

1

地理编码器用于查找地址。“北卡罗来纳州的浸信会”不是一个地址。

您可能需要Places API。但是,这仅限于 60 个结果(3 组 20 个)(对于NearbySearch)或 200 个结果(对于RadarSearch)。

看起来200不会为北卡罗来纳州削减它

于 2013-10-16T14:48:50.647 回答