Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Introduce LatLng.wrap() #4475

Closed
bleege opened this issue Mar 25, 2016 · 2 comments
Closed

Introduce LatLng.wrap() #4475

bleege opened this issue Mar 25, 2016 · 2 comments
Assignees
Labels
Android Mapbox Maps SDK for Android

Comments

@bleege
Copy link
Contributor

bleege commented Mar 25, 2016

As part of #4444 wrapping of LatLng at the JNI level was introduced to help solve issue with the International Date Line / antimeridian. After some more internal discussion with @tobrun @zugaldia and based on feedback from @1ec5 and @jfirebaugh it makes the most sense to introduce a LatLng.wrap() method instead of having to remember to call wrap() on every JNI method. This keeps the Java API and the Core GL API in sync. It also won't negatively impact apps migrating from Google Maps to Mapbox as the Google Map LatLng object is already wrapped.

/cc @mapbox/mobile

@bleege bleege added the Android Mapbox Maps SDK for Android label Mar 25, 2016
@bleege bleege added this to the android-v4.0.0 milestone Mar 25, 2016
bleege added a commit that referenced this issue Mar 25, 2016
bleege added a commit that referenced this issue Mar 25, 2016
@bleege
Copy link
Contributor Author

bleege commented Mar 25, 2016

I added a LatLng.wrap() method (along with Unit test! 😄 ) for general purpose use, but was able to minimize use of wrapping to Telemetry processing of Longitude data and only when the Min / Max Longitude bounds were crossed. Based on the logging below the Production Server was happy. 🎉

This gives us consistently unwrapped LatLng data across Core GL and Java, while also the ability for developers to wrap it if they need to in their apps. It also only impacts the Telemetry code which was the original source of trouble in #4444.

03-25 16:01:34.874 4811-7237/com.mapbox.mapboxsdk.testapp I/MapboxEventManager: Original Lon = -155.8240590583804
03-25 16:01:34.874 4811-7237/com.mapbox.mapboxsdk.testapp I/MapboxEventManager: Original Lon = -169.61663518865407
03-25 16:01:34.874 4811-7237/com.mapbox.mapboxsdk.testapp I/MapboxEventManager: Original Lon = 185.1844022160367
03-25 16:01:34.874 4811-7237/com.mapbox.mapboxsdk.testapp I/MapboxEventManager: Wrapped Lon = -174.8155977839633
03-25 16:01:34.874 4811-7237/com.mapbox.mapboxsdk.testapp I/MapboxEventManager: Original Lon = 172.73351571122566
03-25 16:01:34.874 4811-7237/com.mapbox.mapboxsdk.testapp I/MapboxEventManager: Original Lon = 167.52775514928123
03-25 16:01:34.874 4811-7237/com.mapbox.mapboxsdk.testapp I/MapboxEventManager: Original Lon = 160.28262797806042
03-25 16:01:34.874 4811-7237/com.mapbox.mapboxsdk.testapp I/MapboxEventManager: Original Lon = 168.27910261702857
03-25 16:01:34.884 4811-7237/com.mapbox.mapboxsdk.testapp I/MapboxEventManager: Original Lon = 172.73351571122566
03-25 16:01:34.884 4811-7237/com.mapbox.mapboxsdk.testapp I/MapboxEventManager: Original Lon = -89.4429689
03-25 16:01:34.884 4811-7237/com.mapbox.mapboxsdk.testapp I/MapboxEventManager: Original Lon = 175.79256992437973
03-25 16:01:34.884 4811-7237/com.mapbox.mapboxsdk.testapp I/MapboxEventManager: Original Lon = 179.54930234970067
03-25 16:01:34.884 4811-7237/com.mapbox.mapboxsdk.testapp I/MapboxEventManager: Original Lon = 185.1844022160367
03-25 16:01:34.884 4811-7237/com.mapbox.mapboxsdk.testapp I/MapboxEventManager: Wrapped Lon = -174.8155977839633
03-25 16:01:34.884 4811-7237/com.mapbox.mapboxsdk.testapp I/MapboxEventManager: Original Lon = 190.55116563130503
03-25 16:01:34.884 4811-7237/com.mapbox.mapboxsdk.testapp I/MapboxEventManager: Wrapped Lon = -169.44883436869497
03-25 16:01:34.884 4811-7237/com.mapbox.mapboxsdk.testapp I/MapboxEventManager: Original Lon = 192.91253917558305
03-25 16:01:34.884 4811-7237/com.mapbox.mapboxsdk.testapp I/MapboxEventManager: Wrapped Lon = -167.08746082441695
03-25 16:01:34.884 4811-7237/com.mapbox.mapboxsdk.testapp I/MapboxEventManager: Original Lon = -169.67600706492772
03-25 16:01:34.884 4811-7237/com.mapbox.mapboxsdk.testapp I/MapboxEventManager: Original Lon = 186.56726069208878
03-25 16:01:34.884 4811-7237/com.mapbox.mapboxsdk.testapp I/MapboxEventManager: Wrapped Lon = -173.43273930791122
03-25 16:01:34.884 4811-7237/com.mapbox.mapboxsdk.testapp I/MapboxEventManager: Original Lon = 172.07700389293922
03-25 16:01:34.884 4811-7237/com.mapbox.mapboxsdk.testapp I/MapboxEventManager: Original Lon = 174.6707704861093
03-25 16:01:34.884 4811-7237/com.mapbox.mapboxsdk.testapp I/MapboxEventManager: Original Lon = 172.41673053957464
03-25 16:01:34.884 4811-7237/com.mapbox.mapboxsdk.testapp I/MapboxEventManager: Original Lon = -168.37026269376446
03-25 16:01:34.884 4811-7237/com.mapbox.mapboxsdk.testapp I/MapboxEventManager: Original Lon = -135.90135434956602
03-25 16:01:34.884 4811-7237/com.mapbox.mapboxsdk.testapp I/MapboxEventManager: Original Lon = -159.58210226862263
03-25 16:01:34.884 4811-7237/com.mapbox.mapboxsdk.testapp I/MapboxEventManager: Original Lon = -173.4820144533484
03-25 16:01:34.884 4811-7237/com.mapbox.mapboxsdk.testapp I/MapboxEventManager: Original Lon = -172.99900589337676
03-25 16:01:34.884 4811-7237/com.mapbox.mapboxsdk.testapp I/MapboxEventManager: Original Lon = -178.52677093361487
03-25 16:01:34.884 4811-7237/com.mapbox.mapboxsdk.testapp I/MapboxEventManager: Original Lon = -178.9024434391344
03-25 16:01:34.884 4811-7237/com.mapbox.mapboxsdk.testapp I/MapboxEventManager: Original Lon = -186.1475724528863
03-25 16:01:34.884 4811-7237/com.mapbox.mapboxsdk.testapp I/MapboxEventManager: Wrapped Lon = 173.85242754711373
03-25 16:01:34.884 4811-7237/com.mapbox.mapboxsdk.testapp I/MapboxEventManager: Original Lon = -187.81126839917405
03-25 16:01:34.884 4811-7237/com.mapbox.mapboxsdk.testapp I/MapboxEventManager: Wrapped Lon = 172.18873160082592
03-25 16:01:35.304 4811-7237/com.mapbox.mapboxsdk.testapp I/MapboxEventManager: response code = 204 for events 28

bleege added a commit that referenced this issue Mar 25, 2016
…Javadoc more clear. Making tests consistent.
@bleege bleege self-assigned this Mar 25, 2016
bleege added a commit that referenced this issue Mar 25, 2016
bleege added a commit that referenced this issue Mar 25, 2016
bleege added a commit that referenced this issue Mar 25, 2016
…Javadoc more clear. Making tests consistent.
@bleege
Copy link
Contributor Author

bleege commented Mar 25, 2016

Rebased and merged on to release-ios-3.2.0-android-4.0.0. Will rely on merge into master after release is completed to get functionality integrated for future releases.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Android Mapbox Maps SDK for Android
Projects
None yet
Development

No branches or pull requests

1 participant