Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google maps Ya, Za and $a

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?

like image 826
mihsathe Avatar asked Nov 30 '22 14:11

mihsathe


1 Answers

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.

like image 85
Andrew Leach Avatar answered Dec 05 '22 19:12

Andrew Leach