My favorites | Sign in
Project Home Issues
New issue   Search
for
  Advanced search   Search tips   Subscriptions
Issue 9424: LatLng bug when using {lat: 0, lng: 0}
2 people starred this issue and may be notified of changes. Back to list
Status:  Fixed
Owner:  [email protected]
Closed:  Mar 20


Sign in to add a comment
 
Reported by [email protected], Mar 9, 2016
var coord = new google.maps.LatLng({lat: 0, lng: 0});
coord.lat()//gives NaN, should give 0
coord.lng()//gives NaN, should give 0

Using it as 
coord = new google.maps.LatLng(0, 0) 
works fine, both coord.lat() and coord.lng() gives 0 as expected.

Bug is in function google.maps.LatLng, the conditional 
if (a && (a.lat || a.lng)) is WRONG, 
it should check for 
if (a && (!isNaN(a.lat) || !isNaN(a.lng)))
or similar.
Mar 9, 2016
Project Member #1 [email protected]
Thanks for the bug report.
You're totally right.
Status: Accepted
Owner: [email protected]
Labels: Internal-27571206
Mar 20, 2016
Project Member #2 [email protected]
This issue has been fixed in the latest experimental release.
Status: Fixed
Sign in to add a comment

Powered by Google Project Hosting