You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Out of bounds interaction telemetry events on Android #4444
Seeing some Android interaction events (map.click) come in that have out of bounds values for lng -- in api-events we strictly enforce lat to between -90 and 90, and lng to -180 to 180 so these events are getting filtered out.
I've been able to reproduce the issue for Longitude. It seems centered around the International Date Line. I'll continue looking to see if I can find it elsewhere.
03-2415:08:28.59414948-14948/com.mapbox.mapboxsdk.testappI/MapView: x = 503.0, y = 765.52454; tapLatLng = LatLng [longitude=-170.73755048183057, latitude=20.631945963786507, altitude=0.0]
03-2415:08:28.62414948-14948/com.mapbox.mapboxsdk.testappI/MapView: x = 510.02267, y = 764.4962; tapLatLng = LatLng [longitude=-170.54494119212745, latitude=20.65833841256945, altitude=0.0]
03-2415:08:28.63414948-14948/com.mapbox.mapboxsdk.testappI/MapView: x = 513.0, y = 764.0; tapLatLng = LatLng [longitude=-170.46328199459674, latitude=20.67107244593123, altitude=0.0]
03-2415:08:28.63414948-14948/com.mapbox.mapboxsdk.testappI/MapView: x = 513.0, y = 764.0; tapLatLng = LatLng [longitude=-170.46328199459674, latitude=20.67107244593123, altitude=0.0]
03-2415:08:34.51414948-14948/com.mapbox.mapboxsdk.testappI/MapView: x = 531.0, y = 794.0; tapLatLng = LatLng [longitude=-175.15328030718524, latitude=20.438555684695217, altitude=0.0]
03-2415:08:39.49414948-14948/com.mapbox.mapboxsdk.testappI/MapView: x = 376.0, y = 844.0; tapLatLng = LatLng [longitude=-180.48651391197888, latitude=19.76890837502343, altitude=0.0]
03-2415:08:47.63414948-14948/com.mapbox.mapboxsdk.testappI/MapView: x = 293.0, y = 860.0; tapLatLng = LatLng [longitude=176.30453970395126, latitude=19.48032017375806, altitude=0.0]
03-2415:08:49.57414948-14948/com.mapbox.mapboxsdk.testappI/MapView: x = 409.0, y = 849.0; tapLatLng = LatLng [longitude=177.8952992525888, latitude=19.622469995904936, altitude=0.0]
03-2415:08:50.94414948-14948/com.mapbox.mapboxsdk.testappI/MapView: x = 460.0, y = 838.0; tapLatLng = LatLng [longitude=178.59468496221257, latitude=19.764494192798992, altitude=0.0]
03-2415:08:52.42414948-14948/com.mapbox.mapboxsdk.testappI/MapView: x = 543.0, y = 809.0; tapLatLng = LatLng [longitude=179.7329011302631, latitude=20.138315647099105, altitude=0.0]
03-2415:08:54.02414948-14948/com.mapbox.mapboxsdk.testappI/MapView: x = 610.0, y = 819.0; tapLatLng = LatLng [longitude=180.65170175522468, latitude=20.009511668446294, altitude=0.0]
03-2415:08:56.31414948-14948/com.mapbox.mapboxsdk.testappI/MapView: x = 662.0, y = 803.0; tapLatLng = LatLng [longitude=181.3648013286366, latitude=20.215546908862876, altitude=0.0]
03-2415:08:59.51414948-14948/com.mapbox.mapboxsdk.testappI/MapView: x = 662.0, y = 791.0; tapLatLng = LatLng [longitude=181.3648013286366, latitude=20.36989436476091, altitude=0.0]
03-2415:09:04.88414948-14948/com.mapbox.mapboxsdk.testappI/MapView: x = 646.0, y = 801.0; tapLatLng = LatLng [longitude=-177.07237023360594, latitude=20.13831525485371, altitude=0.0]
03-2415:09:11.38414948-14948/com.mapbox.mapboxsdk.testappI/MapView: x = 509.5, y = 840.0; tapLatLng = LatLng [longitude=-178.94425551524685, latitude=19.635386525623275, altitude=0.0]
03-2415:09:11.40414948-14948/com.mapbox.mapboxsdk.testappI/MapView: x = 509.5, y = 840.0; tapLatLng = LatLng [longitude=-178.94425551524685, latitude=19.635386525623275, altitude=0.0]
03-2415:09:11.41414948-14948/com.mapbox.mapboxsdk.testappI/MapView: x = 885.0, y = 810.0; tapLatLng = LatLng [longitude=-173.7948566008229, latitude=20.02239678589983, altitude=0.0]
03-2415:09:11.42414948-14948/com.mapbox.mapboxsdk.testappI/MapView: x = 508.0, y = 839.0; tapLatLng = LatLng [longitude=-178.96482568317697, latitude=19.64830240999642, altitude=0.0]
03-2415:09:11.42414948-14948/com.mapbox.mapboxsdk.testappI/ScaleGestureDetector: TwScaleGestureDetector03-2415:09:12.38414948-14948/com.mapbox.mapboxsdk.testappI/MapView: x = 886.0, y = 810.0; tapLatLng = LatLng [longitude=-164.81730106297266, latitude=21.333094041341667, altitude=0.0]
03-2415:09:12.84414948-14948/com.mapbox.mapboxsdk.testappI/MapView: x = 544.0, y = 858.5; tapLatLng = LatLng [longitude=-177.9143768488237, latitude=19.732811237540616, altitude=0.0]
03-2415:09:12.85414948-14948/com.mapbox.mapboxsdk.testappI/MapView: x = 544.0, y = 858.5; tapLatLng = LatLng [longitude=-177.9143768488237, latitude=19.732811237540616, altitude=0.0]
03-2415:09:12.86414948-14948/com.mapbox.mapboxsdk.testappI/MapView: x = 869.0, y = 849.0; tapLatLng = LatLng [longitude=-164.59684496399072, latitude=20.09880967753537, altitude=0.0]
03-2415:09:12.86414948-14948/com.mapbox.mapboxsdk.testappI/MapView: x = 543.1528, y = 858.5; tapLatLng = LatLng [longitude=-177.9490937712945, latitude=19.732811237540616, altitude=0.0]
03-2415:09:12.87414948-14948/com.mapbox.mapboxsdk.testappI/ScaleGestureDetector: TwScaleGestureDetector
Was also able to verify this when zoomed out to Zoom 0 and trying to tap the North and South Poles for Latitude range testing around the International Date Line.
03-2415:14:11.42414948-14948/com.mapbox.mapboxsdk.testappI/MapView: x = 351.0, y = 1314.0; tapLatLng = LatLng [longitude=131.04411122034674, latitude=-70.88488827714265, altitude=0.0]
03-2415:14:12.84414948-14948/com.mapbox.mapboxsdk.testappI/MapView: x = 627.0, y = 64.0; tapLatLng = LatLng [longitude=188.78114551104846, latitude=83.71261182839297, altitude=0.0]
03-2415:14:14.98414948-14948/com.mapbox.mapboxsdk.testappI/MapView: x = 644.0, y = 125.0; tapLatLng = LatLng [longitude=197.15329713231466, latitude=82.10275364917152, altitude=0.0]
03-2415:14:15.87414948-14948/com.mapbox.mapboxsdk.testappI/MapView: x = 614.0, y = 28.0; tapLatLng = LatLng [longitude=191.23104134769966, latitude=84.50465429121468, altitude=0.0]
03-2415:14:28.15414948-14948/com.mapbox.mapboxsdk.testappI/MapView: x = 627.0, y = 1607.0; tapLatLng = LatLng [longitude=194.0217541963687, latitude=-83.5699672169096, altitude=0.0]
This regression is due to cutting the release branch after #4275 landed but before #4285 landed. If #4285 remains too risky, we can wrap the coordinates at the SDK/JNI level for each platform as a stopgap.
After consulting with @1ec5@jfirebaugh@brunoabinader and reviewing Google's Android LatLng API I decided that it was safe to wrap at the JNI level for all use cases of nativeLatLngForPixel() as LatLng in the Google API is always wrapped for both Latitude and Longitude. The timing is also right as this is a major semver bump to 4.0.0 so if there was a time to try a change like this it's now.
Google's Android LatLng API
For future archeological digs though, at this time the only place that uses nativeLatLngForPixel() is in MapView.fromScreenLocation() which is used primarily for Telemetry and Gesture handling. It is used once in Projection.fromScreenLocation().
The timing is also right as this is a major semver bump to 4.0.0 so if there was a time to try a change like this it's now.
To clarify, #4464 and #4465prevent a change in behavior as compared to the previous releases. If you ever remove the wrapping, as @jfirebaugh has proposed, we’ll need another semver bump.
Activity
bleege commentedon Mar 24, 2016
I've been able to reproduce the issue for Longitude. It seems centered around the International Date Line. I'll continue looking to see if I can find it elsewhere.
bleege commentedon Mar 24, 2016
Was also able to verify this when zoomed out to Zoom 0 and trying to tap the North and South Poles for Latitude range testing around the International Date Line.
1ec5 commentedon Mar 24, 2016
This regression is due to cutting the release branch after #4275 landed but before #4285 landed. If #4285 remains too risky, we can wrap the coordinates at the SDK/JNI level for each platform as a stopgap.
/cc @jfirebaugh
bleege commentedon Mar 24, 2016
Also noting that this is going to be an issue on the iOS side too.
/cc @boundsj
[ios, osx] Wrap coordinates converted from points
1ec5 commentedon Mar 24, 2016
#4464 mitigates the issue on iOS.
[android] #4444 - Wrapping all LatLng from nativeLatLngForPixel() to …
bleege commentedon Mar 24, 2016
After consulting with @1ec5 @jfirebaugh @brunoabinader and reviewing Google's Android LatLng API I decided that it was safe to wrap at the JNI level for all use cases of
nativeLatLngForPixel()as LatLng in the Google API is always wrapped for both Latitude and Longitude. The timing is also right as this is a major semver bump to4.0.0so if there was a time to try a change like this it's now.Google's Android LatLng API
For future archeological digs though, at this time the only place that uses
nativeLatLngForPixel()is inMapView.fromScreenLocation()which is used primarily for Telemetry and Gesture handling. It is used once inProjection.fromScreenLocation().MapView.fromScreenLocation()
Uses of MapView.fromScreenLocation() In SDK
bleege commentedon Mar 24, 2016
Merged into
release-ios-3.2.0-android-4.0.0and will rely on merge of this branch back intomasterto bring this functionality forward.bleege commentedon Mar 24, 2016
I just used the TestApp pointed against Production to send in a bunch of
map.clickevents and according the logs it happily accepted them! 😄1ec5 commentedon Mar 24, 2016
To clarify, #4464 and #4465 prevent a change in behavior as compared to the previous releases. If you ever remove the wrapping, as @jfirebaugh has proposed, we’ll need another semver bump.
[ios, osx] Wrap coordinates converted from points