Google Places get LatLng

£可爱£侵袭症+ 提交于 2019-11-30 05:08:47

place.geometry.location is a LatLng, so you can call its .lat() and .lng() methods.

var location = place.geometry.location;
var lat = location.lat();
var lng = location.lng();

You'll see that these methods are present in your inspection of this object.

Never use undocumented properties such as the ib and jb you discovered. Google compiles the Maps API using the Closure Compiler or a similar tool, which generates random names for private properties and variables.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!