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

Validate zoom level before creating mapbox telem event #10959

Merged
merged 1 commit into from
Jan 22, 2018

Conversation

tobrun
Copy link
Member

@tobrun tobrun commented Jan 18, 2018

closes #8057

@tobrun tobrun added the Android Mapbox Maps SDK for Android label Jan 18, 2018
@tobrun tobrun added this to the android-v5.3.2 milestone Jan 18, 2018
@tobrun tobrun self-assigned this Jan 18, 2018
@tobrun tobrun requested a review from LukasPaczos January 18, 2018 12:38
@@ -21,24 +22,32 @@
static Hashtable<String, Object> buildMapClickEvent(
@NonNull Location location, @NonNull String gestureId, Transform transform) {
try {
return MapboxEvent.buildMapClickEvent(location, gestureId, transform.getZoom());
double mapZoom = transform.getZoom();
if (mapZoom >= MapboxConstants.MAXIMUM_ZOOM && mapZoom <= MapboxConstants.MAXIMUM_ZOOM) {
Copy link
Contributor

Choose a reason for hiding this comment

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

We should use MapboxConstants.MINIMUM_ZOOM in the first check. Typo? ;)

Copy link
Member Author

Choose a reason for hiding this comment

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

thanks for catching that!

}

@Nullable
static Hashtable<String, Object> buildMapDragEndEvent(
@NonNull Location location, Transform transform) {
try {
return MapboxEvent.buildMapDragEndEvent(location, transform.getZoom());
double mapZoom = transform.getZoom();
if (mapZoom >= MapboxConstants.MAXIMUM_ZOOM && mapZoom <= MapboxConstants.MAXIMUM_ZOOM) {
Copy link
Contributor

Choose a reason for hiding this comment

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

MapboxConstants.MINIMUM_ZOOM missing here as well.

@tobrun tobrun force-pushed the invalid-zoom-level-telem branch from 6e3ee8f to 42c9c8b Compare January 18, 2018 13:06
@tobrun tobrun mentioned this pull request Jan 22, 2018
3 tasks
@tobrun tobrun merged commit d0987e9 into master Jan 22, 2018
@tobrun tobrun deleted the invalid-zoom-level-telem branch January 22, 2018 17:28
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.

Map interaction events sometimes have invalid zoom levels
2 participants