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

Wrapping Telemetry Longitude Data - #4477

Closed
bleege wants to merge 5 commits into
release-ios-3.2.0-android-4.0.0from
4475-wrap-battles
Closed

bleege wants to merge 5 commits into
release-ios-3.2.0-android-4.0.0from
4475-wrap-battles

Conversation

@bleege

@bleege bleege commented Mar 25, 2016

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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

bleege commented Mar 25, 2016

Copy link
Copy Markdown
Contributor Author

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

bleege commented Mar 25, 2016

Copy link
Copy Markdown
Contributor Author

CI is happy! Time to merge!

@bleege

bleege commented Mar 25, 2016

Copy link
Copy Markdown
Contributor Author

Rebased and merged!

@bleege bleege closed this Mar 25, 2016
@bleege
bleege deleted the 4475-wrap-battles branch March 25, 2016 21:56
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor

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

@bleege

bleege commented Mar 28, 2016

Copy link
Copy Markdown
Contributor Author

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