This repository has been archived by the owner on Aug 8, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
LatLng distanceTo returns null for very close points #14216
Comments
Related to but not the same as issue 3556. |
I created a test to find more repros and found loads of very near location pairs that return NaN on my local machine (Android Studio, OSX, unit test)
|
Here is a snippet of output from the above test:
|
bsterry
changed the title
LatLng distanceTo returns null for very close points on Nexus one API 22 emulator
LatLng distanceTo returns null for very close points
Mar 24, 2019
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
LatLng.distanceTo() returns NaN for very close points on Nexus One API 22 emulator (does not repro in two other emulators I tried)
Sample code:
LatLng(40.00599, -105.29261).distanceTo(LatLng(40.005990000000025, -105.29260999999997)
Steps to reproduce
Expected behavior
LatLng.distanceTo() returns 0.0 for any very close points
Actual behavior
LatLng.distnaceTo() returns NaN for some specific very close points in specific environments
It would seem that a test for isNaN(tt) is a safer way to implement this.
Configuration
OSX Android Studio emulator
Android versions:
Android 22
Device models:
Nexus One (emulated)
Mapbox SDK versions:
7.2
The text was updated successfully, but these errors were encountered: