谷歌地图自动完成API V3突然停止工作 [英] Google maps autocomplete api v3 suddenly stopped working

查看:116
本文介绍了谷歌地图自动完成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.

这篇关于谷歌地图自动完成API V3突然停止工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆