没有地图的地理编码 [英] Geocoding without map
问题描述
我可以在没有地图的情况下使用Google地图地理编码API吗?
我有一个带有自动完成Google Maps API Place的文本框,我想在用户输入街道号后获得邮政编码。
Regards
自动填充是允许使用Google Maps API服务的少数情况之一没有地图,但如果您将地图与地图一起使用,必须是Google地图:
https://developers.google.com/maps/documentation/javascript/places#places_autocomplete
您不需要使用Geocoder来提取邮政编码。它在place_changed事件发生后(即用户选择完成后)在Autocomplete对象上的getPlaces()调用返回的PlaceResult对象中提供:
https://developers.google.com/maps/documentation/javascript/places#getting_place_information
Can I to use Google maps geocode API without map? I have a textbox with autocomplete Google Maps API Place and I want after the user has typed the street number, I get the zip code. Regards
Autocomplete is one of a small number of cases where it is permitted to use a Google Maps API service without a map, although if you do use it in conjunction with a map that map must be a Google Map:
https://developers.google.com/maps/documentation/javascript/places#places_autocomplete
You don't need to use the Geocoder to extract the zipcode. It is provided in the PlaceResult object returned by a getPlaces() call on the Autocomplete object after place_changed event has occurred (ie. once a user has selected a completion):
https://developers.google.com/maps/documentation/javascript/places#getting_place_information
这篇关于没有地图的地理编码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!