I think 地理编码API https://developers.google.com/maps/documentation/geocoding/intro是您的最佳选择。地理编码是将地址(例如“1600 Amphitheatre Parkway, Mountain View, CA”)转换为地理坐标(例如纬度 37.423021 和经度 -122.083739)的过程,您可以使用它在地图上放置标记或定位地图。
如果您想通过 HTTP 访问 Google Maps Geocoding API,则可以按照上面文档链接中的指南进行操作。
https://maps.googleapis.com/maps/api/geocode/json?address=13th%20and%20Walnut,%20Philadelphia,%20PA
此请求将返回给您一个"lat" : 39.95043578029149
and "lng" : -75.1607739197085.
如果你想知道如何编码,那么你可以查看示例代码here https://developers.google.com/maps/documentation/javascript/examples/geocoding-simple和这个jsfiddle https://jsfiddle.net/alvaroAV/qn8bb8q5/
关于免费计划的问题, 地理编码 API 每天最多可免费处理 2,500 个请求。如果您达到此限制,系统将向您收取 0.50 美元/1,000 个额外请求的费用,每天最多 100,000 个请求。
有关 Google MAPS API 价格详情的更多信息,请查看此link https://developers.google.com/maps/pricing-and-plans/.