问题描述
当我访问Places API时,Google会发送一个包含以下两个属性的对象:
位置.geometry.G
location.geometry.K
这些代表纬度和经度。我从来没有在任何地方读过这些。此外,我所有的代码库最近变得不稳定,因为它最近改变了字母H& L.
这很奇怪,不是吗?我错过了什么?
这些是API的非文档属性(特定google.maps.LatLng的纬度和经度通过使用记录的方法( .lng() .lat()
,)来可靠地访问它们。
)
When I access the Places API, Google sends back an object with, among other things, these two properties :
location.geometry.G
location.geometry.K
These represent the latitude and longitudes. I never read about these anywhere. Besides, all my codebase recently became unstable because it recently changed for the letters H & L.
This is weird, isn't it ? What did I miss ?
Those are undocumented properties of the API (the latitude and longitude of that particular google.maps.LatLng object)
Access them reliably by using the documented methods (.lat()
, .lng()
)
这篇关于Google地图 - 奇怪的geometry.location属性(G,K)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!