blob: 97734de4933eb953cb337e277877c0c164c069ed (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
package com.mapbox.mapboxsdk.maps;
import android.location.Location;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import com.mapbox.services.android.telemetry.MapboxEvent;
import java.util.Hashtable;
/**
* Wrapper class for MapboxEvent
* <p>
* Provides facility methods to use Transform and handle the case that the zoom, required for a telemetry event,
* isn't available yet.
* </p>
*/
class MapboxEventWrapper {
@Nullable
static Hashtable<String, Object> buildMapClickEvent(
@NonNull Location location, @NonNull String gestureId, Transform transform) {
try {
return MapboxEvent.buildMapClickEvent(location, gestureId, transform.getZoom());
} catch (NullPointerException exception) {
// Map/Transform is not ready yet #8650
// returning null is valid, event is ignored.
return null;
}
}
@Nullable
static Hashtable<String, Object> buildMapDragEndEvent(
@NonNull Location location, Transform transform) {
try {
return MapboxEvent.buildMapDragEndEvent(location, transform.getZoom());
} catch (NullPointerException exception) {
// Map/Transform is not ready yet #8650
// returning null is valid, event is ignored.
return null;
}
}
@Nullable
static Hashtable<String, Object> buildMapLoadEvent() {
return MapboxEvent.buildMapLoadEvent();
}
}
|