com.mapbox.mapboxsdk.maps.MapboxEventWrapper Maven / Gradle / Ivy
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
*
* Provides facility methods to use Transform and handle the case that the zoom, required for a telemetry event,
* isn't available yet.
*
*/
class MapboxEventWrapper {
@Nullable
static Hashtable 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 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 buildMapLoadEvent() {
return MapboxEvent.buildMapLoadEvent();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy