gpt4 book ai didi

javascript - 从经度和纬度google api获取邮政编码

转载 作者:行者123 更新时间:2023-12-01 06:54:34 26 4
gpt4 key购买 nike

我只需要知道如何从经度和纬度获取邮政编码。

我使用谷歌地图 API 根据“曼彻斯特”等搜索来获取经度和纬度,然后我需要从中获取邮政编码以查询我的数据库。

到目前为止我的代码是

function getLatLng()
{
var localSearch = new google.maps.Geocoder();
var postcode = $("#address").val();
localSearch.geocode({ 'address': postcode },
function(results, status) {
if (results.length == 1) {
var result = results[0];
var location = result.geometry.location;
}
else
{
$("#error").html("Address not found");
}
});
}

最佳答案

关于javascript - 从经度和纬度google api获取邮政编码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10524474/

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