2016-09-14 71 views
0

谷歌提供检索反向地理编码结果的两种方法 - Web服务API:谷歌地图API - 反向地理编码相同place_id,JS API返回的结果,但网络API不

https://maps.googleapis.com/maps/api/geocode/json?address=place_id:xxxxxxxxxxx&key=YOUR_API_KEY

或一个Javascript地图API:

https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&callback=initMap

我发现,与后者(JS),而不是前者(网络服务)返回结果place_id值 - 返回值为ZERO_RESULTS (The request did not encounter any errors but, but returned no results)。 Web服务是否存在限制?

一个例子place_id值与2号(JS),而不是#1(Web服务)的工作原理:ChIJY01wxrsV64YR40ZRS9kaz_U

Web服务(#1):https://google-developers.appspot.com/maps/documentation/utils/geocoder/embed

的Javascript服务(#2):https://google-developers.appspot.com/maps/documentation/javascript/examples/full/geocoding-place-id

回答

1

根据我所知,地理编码API的place_ids不应该有任何限制。我测试了您的垂询

https://maps.googleapis.com/maps/api/geocode/json?place_id=ChIJY01wxrsV64YR40ZRS9kaz_U&key=[YOUR_API_KEY]

,我能得到相应的信息(而不是ZERO RESULTS你遇到过)。

您引用的Web服务(#1)是用于地理编码而不是反向地理编码。如果您将“227 Bedford”绘制到它上面,您可以通过检查控制台检查它是否具有相同的place_id

相关问题