gpt4 book ai didi

javascript - 谷歌地理编码器/Javascript : How to send a broad search

转载 作者:行者123 更新时间:2023-11-28 01:53:48 25 4
gpt4 key购买 nike

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

在 Google map 上,我可以输入“北卡罗来纳州的浸信会”,然后我会得到一张布满小红点的 map ,每个红点都是名称中带有“浸信会”一词的位置。

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

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

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 map 上输入“北卡罗来纳州浸信会”时返回的完整列表。

有人知道如何获取完整列表吗?其他函数或库?

谢谢!

最佳答案

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

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

looks like 200 isn't going to cut it for North Carolina

关于javascript - 谷歌地理编码器/Javascript : How to send a broad search,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19406297/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com