我正在为ANDROID和IOS开发移动应用程序。我希望通过应用程序向API传递纬度,经度。哪个Google API用于从地址获取经度和经度,另外让我知道在php和android和ios中每天调用API有任何每日限制。
您可以使用Google提供的以下API:https://developers.google.com/maps/documentation/javascript/geocoding#ReverseGeocoding
价格和限制可以在这里找到:https://developers.google.com/maps/documentation/geocoding/usage-and-billing
截至目前,服务器端API限制为每秒50个请求,并支持100,000个每日免费请求。
<script
src="https://code.jquery.com/jquery-3.3.1.min.js"
integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8="
crossorigin="anonymous">
// get you address field
var city = document.getElementById("home_city_select").value;
var jsonLtdLng="https://maps.googleapis.com/maps/api/geocode/json?address="+city+"&key=API_KEY";
$.getJSON(jsonLtdLng, function (data) {
console.log(data.results[0].geometry.location.lat);
console.log(data.results[0].geometry.location.lng);
});
</script>