Closed pedestrianlove closed 2 weeks ago
預計會使用plus code API取代原有的geocode API:
Example:
https://plus.codes/api?key=GOOGLE_TOKEN&address=地址
Result(不是上面回傳的結果):
{ "results": [ { "address_components": [ { "long_name": "Avenue Machado Santos", "short_name": "Ave Machado Santos", "types": [ "route" ] }, { "long_name": "Praia", "short_name": "Praia", "types": [ "locality", "political" ] }, { "long_name": "Praia", "short_name": "Praia", "types": [ "administrative_area_level_1", "political" ] }, { "long_name": "Cape Verde", "short_name": "CV", "types": [ "country", "political" ] } ], "formatted_address": "Ave Machado Santos, Praia, Cape Verde", "geometry": { "bounds": { "northeast": { "lat": 14.9192329, "lng": -23.5094639 }, "southwest": { "lat": 14.9165614, "lng": -23.5108249 } }, "location": { "lat": 14.917857, "lng": -23.510049 }, "location_type": "GEOMETRIC_CENTER", "viewport": { "northeast": { "lat": 14.9192461302915, "lng": -23.5087954197085 }, "southwest": { "lat": 14.9165481697085, "lng": -23.5114933802915 } } }, "place_id": "ChIJabhTnOOYNQkR0uozHYX4gIk", "types": [ "route" ], "plus_code": { "global_code": "796RWF8Q+WF", "geometry": { "bounds": { "northeast": { "lat": 14.917375000000007, "lng": -23.511250000000018 }, "southwest": { "lat": 14.91725000000001, "lng": -23.511375000000015 } }, "location": { "lat": 14.917312500000008, "lng": -23.511312500000017 } }, "api_cost": 1, "local_code": "WF8Q+WF", "local_address": "Praia, Cape Verde", "locality_place_id": "ChIJV_GnJLaQNQkR8sSzx_UCrKA" } }, { "address_components": [ { "long_name": "Várzea", "short_name": "Várzea", "types": [ "neighborhood", "political" ] }, { "long_name": "Praia", "short_name": "Praia", "types": [ "locality", "political" ] }, { "long_name": "Praia", "short_name": "Praia", "types": [ "administrative_area_level_1", "political" ] }, { "long_name": "Cape Verde", "short_name": "CV", "types": [ "country", "political" ] } ], "formatted_address": "Várzea, Praia, Cape Verde", "geometry": { "bounds": { "northeast": { "lat": 14.9210663, "lng": -23.5105061 }, "southwest": { "lat": 14.9138092, "lng": -23.5176301 } }, "location": { "lat": 14.9172665, "lng": -23.5140708 }, "location_type": "APPROXIMATE", "viewport": { "northeast": { "lat": 14.9210663, "lng": -23.5105061 }, "southwest": { "lat": 14.9138092, "lng": -23.5176301 } } }, "place_id": "ChIJ6weAsPyYNQkR1hPaMKHw67s", "types": [ "neighborhood", "political" ], "plus_code": { "global_code": "796RWF8P+", "geometry": { "bounds": { "northeast": { "lat": 14.917500000000004, "lng": -23.512500000000017 }, "southwest": { "lat": 14.915000000000006, "lng": -23.515000000000015 } }, "location": { "lat": 14.916250000000005, "lng": -23.513750000000016 } } } }, // additional results
剛剛一試發現他們文件可能有一段時間沒有更新過了,所以API回應格式完全不同。 所以應該還是會保留原有的geocoding api,跟plus code api共存。
預計會使用plus code API取代原有的geocode API:
Example:
Result(不是上面回傳的結果):