diff options
author | Łukasz Paczos <lukasz.paczos@mapbox.com> | 2018-07-17 10:36:47 +0200 |
---|---|---|
committer | Łukasz Paczos <lukasz.paczos@mapbox.com> | 2018-07-17 11:20:26 +0200 |
commit | a45dd30e4400e3a4d7e1b98cd22da30cf8010f90 (patch) | |
tree | 034c544dd36d85d35bb9ed9eebe3725eec3ea703 | |
parent | aeb85dbd8ccd73a7a4f4cb66e4ead75bcd1ab0bc (diff) | |
download | qtlocation-mapboxgl-a45dd30e4400e3a4d7e1b98cd22da30cf8010f90.tar.gz |
[android] harden map events creation
-rw-r--r-- | platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapGestureDetector.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapGestureDetector.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapGestureDetector.java index 6cb09f2195..fc4b13a293 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapGestureDetector.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapGestureDetector.java @@ -22,6 +22,7 @@ import com.mapbox.android.gestures.StandardScaleGestureDetector; import com.mapbox.android.telemetry.Event; import com.mapbox.android.telemetry.MapEventFactory; import com.mapbox.android.telemetry.MapState; +import com.mapbox.android.telemetry.MapboxTelemetry; import com.mapbox.mapboxsdk.R; import com.mapbox.mapboxsdk.camera.CameraPosition; import com.mapbox.mapboxsdk.constants.MapboxConstants; @@ -886,11 +887,12 @@ final class MapGestureDetector { if (cameraPosition != null) { double zoom = cameraPosition.zoom; if (isZoomValid(zoom)) { + MapboxTelemetry telemetry = Telemetry.obtainTelemetry(); MapEventFactory mapEventFactory = new MapEventFactory(); LatLng latLng = projection.fromScreenLocation(focalPoint); MapState state = new MapState(latLng.getLatitude(), latLng.getLongitude(), zoom); state.setGesture(eventType); - Telemetry.obtainTelemetry().push(mapEventFactory.createMapGestureEvent(Event.Type.MAP_CLICK, state)); + telemetry.push(mapEventFactory.createMapGestureEvent(Event.Type.MAP_CLICK, state)); } } } |