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

Wrapping Telemetry Longitude Data #4477

Closed
wants to merge 5 commits into from

Conversation

bleege
Copy link
Contributor

@bleege bleege commented Mar 25, 2016

Closes #4475

@bleege bleege added Android Mapbox Maps SDK for Android ✓ ready for review labels Mar 25, 2016
@bleege bleege added this to the android-v4.0.0 milestone Mar 25, 2016
import java.util.Objects;

import dalvik.annotation.TestTargetClass;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The addition of this import seems unnecessary.

…Javadoc more clear. Making tests consistent.
@bleege
Copy link
Contributor Author

bleege commented Mar 25, 2016

Just made the changes recommended by @zugaldia. When CI approves I'll merge this into release-ios-3.2.0-android-4.0.0.

@bleege
Copy link
Contributor Author

bleege commented Mar 25, 2016

CI is happy! Time to merge!

@bleege
Copy link
Contributor Author

bleege commented Mar 25, 2016

Rebased and merged!

@bleege bleege closed this Mar 25, 2016
@bleege bleege deleted the 4475-wrap-battles branch March 25, 2016 21:56
@@ -551,7 +553,16 @@ protected Void doInBackground(Void... voids) {
jsonObject.putOpt(MapboxEvent.ATTRIBUTE_SOURCE, evt.get(MapboxEvent.ATTRIBUTE_SOURCE));
jsonObject.putOpt(MapboxEvent.ATTRIBUTE_SESSION_ID, evt.get(MapboxEvent.ATTRIBUTE_SESSION_ID));
jsonObject.putOpt(MapboxEvent.KEY_LATITUDE, evt.get(MapboxEvent.KEY_LATITUDE));
jsonObject.putOpt(MapboxEvent.KEY_LONGITUDE, evt.get(MapboxEvent.KEY_LONGITUDE));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be wrapped using LatLng.wrap here rather than duplicating the conditionals for wrapping.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Normally I'd agree that conditional wrapping should be avoided, however in this case it's needed. Reason being is that Latitude and Longitude data can also come from other events besides location. Specifically gesture events like map.click and map.dragend. This is handled automatically via json.putOpt() for Latitude because it's value (if one exists) can always be used as is.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bleege My point is that we should reuse LatLng.wrap, which already has all the correct logic, whenever we add coordinates to the event queue. There's no need to duplicate the code.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jfirebaugh Ah... my mistake. I saw the comment attached to Line 554 and thought you were referring to the jsonObject.putOpt() for Longitude and didn't follow that you were referring to wrap tests itself. I follow your thinking now about creating a new LatLng with a constant Latitude and the specific Longitude to be wrapped.

@jfirebaugh
Copy link
Contributor

Did you audit the other places MapView.fromScreenLocation is used to determine whether or not they need wrapping?

@bleege
Copy link
Contributor Author

bleege commented Mar 28, 2016

The primary goal was to minimally impact the code base this late in the release process, so this was deliberately scoped to the Telemetry issue from #4444. We can and should do a further investigation for the next release.

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

Successfully merging this pull request may close these issues.

4 participants