谷歌地图自动完成API V3突然停止工作
所以我很惊喜改变没有code。在所有的谷歌地图自动完成API突然停止工作后找到。我注销结果,看看发生了什么事。
So I was surprises to find after changing no code at all that the Google Maps auto-complete API suddenly stopped working. I logged out the results to see what was happening.
我有previously已越来越从自动完成地址的经纬度LNG如下:
I had previously been getting a lat lng from an auto-completed address as follows:
new google.maps.LatLng(from_autocomplete.getPlace().geometry.location.d, from_autocomplete.getPlace().geometry.location.e);
在d和e是纬度和经度COORDS。我发现的错误是从自动完成对象(autocomplete.getPlace()geometry.location)响应是现在:
the d and e being the lat and lng coords. I found the error to be that the response from the autocomplete object (autocomplete.getPlace().geometry.location) is now:
k: 53.002668, A: -2.179403999999977
为什么会d和e突然更改为K和阿?它已工作了数周,然后这种改变,恕不另行通知。
Why would the d and e suddenly change to a K and A? It had been working for weeks and then this changed without notice.
您使用它可以随时改变内部对象结构的属性。
You used properties of internal object structure which can change any time.
几何
是 google.maps.places.PlaceGeometry
键入财产位置
这是一个 google.maps.LatLng
类。你可以得到纬度和经度使用官方支持的纬度()
和 LNG()
方法。
geometry
is google.maps.places.PlaceGeometry
type with property location
which is a google.maps.LatLng
class. You can get latitude and longitude using officially supported lat()
and lng()
methods.