谷歌地图Ya,Za和$ a [英] Google maps Ya, Za and $a

查看:134
本文介绍了谷歌地图Ya,Za和$ a的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Google地图来查找点击位置的纬度和经度。在对javascript事件对象进行字符串化后,我发现

  {latLng:{Za:25.800813110356653,$ a: 78.7055234375}pixel:{x:689,y:336},va:{x:183.96837222222223,y:108.99927181860028}} 



所以Za现在是lat和$ a是lng。



虽然两天前,我正在使用完全相同的代码,并获得相同的对象:

  {latLng:{Ya:25.800813110356653,Za :78.7055234375},pixel:{x:689,y:336},va:{x:183.96837222222223,y:108.99927181860028}} 

困扰我的是他们在一夜之间改变了对象名称。为什么他们这样做,是否有任何可靠的方法来查找经度和纬度呢?

解决方案

:如果引入了另一个标记,那么一个变为 Ya 的变量可能最终为 Za



您应永远访问内部参考。 始终使用记录的方法。


I am using google maps to find lat and lng of the clicked location. After stringifying the javascript event object, I found

{"latLng":{"Za":25.800813110356653,"$a":78.7055234375},"pixel":{"x":689,"y":336},"va":{"x":183.96837222222223,"y":108.99927181860028}}

So Za is lat and $a is lng now.

Though two days ago, I was using exact same code and getting the same object as:

{"latLng":{"Ya":25.800813110356653,"Za":78.7055234375},"pixel":{"x":689,"y":336},"va":{"x":183.96837222222223,"y":108.99927181860028}}

What bothers me is that they have changed the object names overnight. Why do they do this and is there any reliable way to find latitude and longitude instead?

解决方案

Internal names will change with code changes: if another token is introduced then a variable which was minifed as Ya may end up being Za.

You should never access internal references. Always use documented methods.

这篇关于谷歌地图Ya,Za和$ a的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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